mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Rollup merge of #128412 - compiler-errors:crate-level-only, r=cjgillot
Remove `crate_level_only` from `ELIDED_LIFETIMES_IN_PATHS`
As far as I can tell, we provide the right node id to the `ELIDED_LIFETIMES_IN_PATHS` lint:
f8060d282d/compiler/rustc_resolve/src/late.rs (L2015-L2027)
So I've gone ahead and removed the restriction from this lint.
This commit is contained in:
commit
06b837231a
@ -1834,8 +1834,7 @@ declare_lint! {
|
||||
/// [placeholder lifetime]: https://doc.rust-lang.org/reference/lifetime-elision.html#lifetime-elision-in-functions
|
||||
pub ELIDED_LIFETIMES_IN_PATHS,
|
||||
Allow,
|
||||
"hidden lifetime parameters in types are deprecated",
|
||||
crate_level_only
|
||||
"hidden lifetime parameters in types are deprecated"
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
|
11
tests/ui/lifetimes/elided-lint-in-mod.rs
Normal file
11
tests/ui/lifetimes/elided-lint-in-mod.rs
Normal file
@ -0,0 +1,11 @@
|
||||
struct Foo<'a>(&'a ());
|
||||
|
||||
fn test(_: Foo) {}
|
||||
|
||||
#[deny(elided_lifetimes_in_paths)]
|
||||
mod w {
|
||||
fn test2(_: super::Foo) {}
|
||||
//~^ ERROR hidden lifetime parameters in types are deprecated
|
||||
}
|
||||
|
||||
fn main() {}
|
20
tests/ui/lifetimes/elided-lint-in-mod.stderr
Normal file
20
tests/ui/lifetimes/elided-lint-in-mod.stderr
Normal file
@ -0,0 +1,20 @@
|
||||
error: hidden lifetime parameters in types are deprecated
|
||||
--> $DIR/elided-lint-in-mod.rs:7:24
|
||||
|
|
||||
LL | fn test2(_: super::Foo) {}
|
||||
| -------^^^
|
||||
| |
|
||||
| expected lifetime parameter
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/elided-lint-in-mod.rs:5:8
|
||||
|
|
||||
LL | #[deny(elided_lifetimes_in_paths)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: indicate the anonymous lifetime
|
||||
|
|
||||
LL | fn test2(_: super::Foo<'_>) {}
|
||||
| ++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
Loading…
Reference in New Issue
Block a user