We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec14d07 commit ab9eed7Copy full SHA for ab9eed7
text/0000-associated-const-underscore.md
@@ -572,6 +572,28 @@ The following details are called out as being worth testing:
572
}
573
```
574
575
+7. Underscore constants are not dead code, despite not being referenced.
576
+
577
+ ```rust
578
+ #![deny(dead_code)]
579
580
+ pub struct Struct;
581
582
+ const _: () = {
583
+ let _ = Struct;
584
+ };
585
586
+ impl Struct {
587
588
589
590
591
592
+ struct Unused; // error: dead code
593
594
+ }
595
+ ```
596
597
# Drawbacks
598
[drawbacks]: #drawbacks
599
0 commit comments