-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
#![allow(dead_code)]
#![deny(explicit_outlives_requirements)]
struct Test<'a, T>(&'a T) where T: ?Sized;
Errors:
Compiling playground v0.0.1 (/playground)
error: outlives requirements can be inferred
--> src/lib.rs:4:19
|
4 | struct Test<'a, T>(&'a T) where T: ?Sized;
| ^^^^^^^^^^^^^^^^^^^^^^^ help: remove these bounds
|
note: lint level defined here
--> src/lib.rs:2:9
|
2 | #![deny(explicit_outlives_requirements)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Maybe I'm missing something, but this lint error makes no sense in this context, as there are no outlives bounds written.
Curiously, struct Test<'a, T: ?Sized>(&'a T);
compiles without error.
hellow554, taiki-e and fogti
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.