-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Do not complain about unused code when used in impl
Self
type
#63317
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
|
||
#![deny(dead_code)] | ||
|
||
const TLC: usize = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No complaint about TLC being unused
} | ||
|
||
struct X; | ||
struct Y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No complaint about Y being unused
} | ||
|
||
fn main() {} | ||
fn main() { | ||
let x = Foo::Bar(42); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added to remove the warning for Foo::Bar
, not Foo
.
@@ -5,12 +5,15 @@ | |||
// when deriving Debug on an empty enum | |||
|
|||
#[derive(Debug)] | |||
enum Void {} //~ WARN never used | |||
enum Void {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is to verify that this doesn't emit a warning due to derive
.
Ping from triage, @matthewjasper can you please review this. @estebank any updates after RalfJung last comment. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with comments addressed
@bors r=matthewjasper |
📌 Commit 7def99a has been approved by |
Do not complain about unused code when used in `impl` `Self` type Fix rust-lang#18290.
Rollup of 6 pull requests Successful merges: - #63317 (Do not complain about unused code when used in `impl` `Self` type) - #63693 (Fully implement or-pattern parsing) - #63836 (VxWorks does not provide a way to set the task name except at creation time) - #63845 (Removed a confusing FnOnce example) - #63855 (Refactor feature gates) - #63921 (add link to FileCheck docs) Failed merges: r? @ghost
Fix #18290.