Skip to content

Commit 9573841

Browse files
committed
UI test: "elided" has just the one 'l'; exercise underscore lifetime
The files were named 'ellided-lifetimes', but the word "elided" only has one 'l' (see, e.g., https://en.wiktionary.org/wiki/elide). We add a couple lines to the test that exercise underscore lifetimes with the elided-lifetimes-in-paths lint: in the current implementation, the lint fires (as one can see in the expectation file), but it really shouldn't (notice that the message says to use an underscore lifetime!); this is to be fixed in another commit.
1 parent 0ad8f9e commit 9573841

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

src/test/ui/in-band-lifetimes/ellided-lifetimes.rs renamed to src/test/ui/in-band-lifetimes/elided-lifetimes.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
#![allow(warnings)]
11-
#![allow(unused_variables, dead_code, unused, bad_style)]
10+
11+
#![allow(unused)]
1212
#![deny(elided_lifetimes_in_paths)]
1313

1414
struct Foo<'a> { x: &'a u32 }
15+
1516
fn foo(x: &Foo) {
1617
//~^ ERROR: hidden lifetime parameters are deprecated, try `Foo<'_>`
1718
}
1819

20+
fn bar(x: &Foo<'_>) {
21+
//~^ ERROR: hidden lifetime parameters are deprecated, try `Foo<'_>`
22+
}
23+
1924
fn main() {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: hidden lifetime parameters are deprecated, try `Foo<'_>`
2+
--> $DIR/elided-lifetimes.rs:16:12
3+
|
4+
LL | fn foo(x: &Foo) {
5+
| ^^^
6+
|
7+
note: lint level defined here
8+
--> $DIR/elided-lifetimes.rs:12:9
9+
|
10+
LL | #![deny(elided_lifetimes_in_paths)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+
error: hidden lifetime parameters are deprecated, try `Foo<'_>`
14+
--> $DIR/elided-lifetimes.rs:20:16
15+
|
16+
LL | fn bar(x: &Foo<'_>) {
17+
| ^^
18+
19+
error: aborting due to 2 previous errors
20+

src/test/ui/in-band-lifetimes/ellided-lifetimes.stderr

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)