-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
False positive dead_code
for const used as const generic argument during impl marker trait
#128617
Comments
dead_code
for const used as const generic argument during trait impl (regressed in 1.80.0)dead_code
for const used as const generic argument during impl of empty trait (regressed in 1.80.0)
dead_code
for const used as const generic argument during impl of empty trait (regressed in 1.80.0)dead_code
for const used as const generic argument during impl of empty trait
dead_code
for const used as const generic argument during impl of empty traitdead_code
for const used as const generic argument during impl of empty trait
dead_code
for const used as const generic argument during impl of empty traitdead_code
for const used as const generic argument during impl marker trait
Potentially fixed by #128404. Have no opportunity to test RN, but saw this come by and it seemed potentially relevant. |
@datdenkikniet: This is indeed fixed by that PR. |
cc @mu001999: This is another regression that should be fixed first if the dead code changes are re-landed. |
This is fixed in the new point release, 1.80.1. Should we close this issue, or keep it open for tracking? |
This is probably worth keeping open for tracking purposes, and probably should be closed by the re-land PR(s) that add this case as a regression(?) test. |
This reverts commit b3e9cc7.
This reverts commit b3e9cc7.
In the following snippet,
CONST
gets adead_code
warning. However,CONST
is most definitely used and the trait is also pub, so this warning seems incorrect.Removing
CONST
causes the crate to no longer compile, and removing the impl would be a breaking change.Adding any function (i.e.
fn method();
) to the trait and implementing it removes the warning as well. However, for marker traits this is not an option. It also clearly demonstrates thatCONST
is considered to be used despite being unaffected byfn method()
.Rust version: rustc 1.80.0 (0514789 2024-07-21)
This code compiles without warnings on 1.79.0 (rustc 1.79.0 (129f3b9 2024-06-10))
Warning:
Adding
method()
removes the warning:The text was updated successfully, but these errors were encountered: