File tree 3 files changed +32
-2
lines changed
compiler/rustc_lint_defs/src
3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -1836,8 +1836,7 @@ declare_lint! {
1836
1836
/// [placeholder lifetime]: https://doc.rust-lang.org/reference/lifetime-elision.html#lifetime-elision-in-functions
1837
1837
pub ELIDED_LIFETIMES_IN_PATHS ,
1838
1838
Allow ,
1839
- "hidden lifetime parameters in types are deprecated" ,
1840
- crate_level_only
1839
+ "hidden lifetime parameters in types are deprecated"
1841
1840
}
1842
1841
1843
1842
declare_lint ! {
Original file line number Diff line number Diff line change
1
+ struct Foo < ' a > ( & ' a ( ) ) ;
2
+
3
+ fn test ( _: Foo ) { }
4
+
5
+ #[ deny( elided_lifetimes_in_paths) ]
6
+ mod w {
7
+ fn test2 ( _: super :: Foo ) { }
8
+ //~^ ERROR hidden lifetime parameters in types are deprecated
9
+ }
10
+
11
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: hidden lifetime parameters in types are deprecated
2
+ --> $DIR/elided-lint-in-mod.rs:7:24
3
+ |
4
+ LL | fn test2(_: super::Foo) {}
5
+ | -------^^^
6
+ | |
7
+ | expected lifetime parameter
8
+ |
9
+ note: the lint level is defined here
10
+ --> $DIR/elided-lint-in-mod.rs:5:8
11
+ |
12
+ LL | #[deny(elided_lifetimes_in_paths)]
13
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
14
+ help: indicate the anonymous lifetime
15
+ |
16
+ LL | fn test2(_: super::Foo<'_>) {}
17
+ | ++++
18
+
19
+ error: aborting due to 1 previous error
20
+
You can’t perform that action at this time.
0 commit comments