Skip to content

Commit d8c58d4

Browse files
committed
re-add accidentally removed line
1 parent 5114f8a commit d8c58d4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/librustc_typeck/check/wfcheck.rs

+1
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
480480
(ast_generics.lifetimes[index].lifetime.span,
481481
ast_generics.lifetimes[index].lifetime.name)
482482
} else {
483+
let index = index - ast_generics.lifetimes.len();
483484
(ast_generics.ty_params[index].span,
484485
ast_generics.ty_params[index].name)
485486
};

src/test/compile-fail/issue-36299.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct Foo<'a, A> {}
12+
//~^ ERROR parameter `'a` is never used
13+
//~| ERROR parameter `A` is never used
14+
15+
fn main() {}

0 commit comments

Comments
 (0)