You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a warning about F being unused in method _unused2, while there isn't about the same situation in function _unused1:
Compiling playground v0.0.1 (/playground)
warning: constant item is never used: `F`
--> src/lib.rs:11:9
|
11 | const F: i32 = 2;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Finished dev [unoptimized + debuginfo] target(s) in 0.54s
Local variable g is also not reported as unused in either case. Unless I'm mistaken, F and g are similar in that they are local to the function/method. I would expect no warning for this code.
Note that this is different from #47133 because here the const is local, which I think makes the case more clear-cut.
The text was updated successfully, but these errors were encountered:
dbdr
changed the title
Inconsistent unused warning for const inside unused methods (but not functions)
Inconsistent unused warning for local const inside unused methods (but not functions)
Feb 10, 2020
(Playground)
There is a warning about F being unused in method _unused2, while there isn't about the same situation in function _unused1:
Local variable g is also not reported as unused in either case. Unless I'm mistaken, F and g are similar in that they are local to the function/method. I would expect no warning for this code.
Note that this is different from #47133 because here the const is local, which I think makes the case more clear-cut.
The text was updated successfully, but these errors were encountered: