Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove crate_level_only from ELIDED_LIFETIMES_IN_PATHS #128412

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1836,8 +1836,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! {
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/lifetimes/elided-lint-in-mod.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 20 additions & 0 deletions tests/ui/lifetimes/elided-lint-in-mod.stderr
Original file line number Diff line number Diff line change
@@ -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