-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Regression of #53738: spurious single_use_lifetimes warning #69952
Comments
From what I can tell, the |
It also fails in 1.40 and 1.41. It gets a different error in 1.39, with |
@rustbot ping cleanup |
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good cc @AminArria @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @jakevossen5 @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @senden9 @shekohex @sinato @spastorino @turboladen @woshilapin @yerke |
bisect-rustc: searched nightlies: from nightly-2019-09-01 to nightly-2020-03-10 #[deny(single_use_lifetimes)]
#[derive(Eq)]
struct Foo<'a, T> {
_y: &'a mut T,
}
impl<T> PartialEq for Foo<'_, T> {
fn eq(&self, _x: &Self) -> bool {
true
}
} Builds without errors as of rustc 1.39.0 and earlier (tested on godbolt) ErrorCOLLAPSIBLE ERROR STACKTRACE
error: lifetime parameter `'a` only used once
--> src/main.rs:4:12
|
3 | #[derive(Eq)]
| -- ...is used only here
4 | struct Foo<'a, T> {
| ^^ this lifetime...
|
note: the lint level is defined here
--> src/main.rs:1:8
|
1 | #[deny(single_use_lifetimes)]
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: could not compile `bisectit`.
To learn more, run the command again with --verbose. |
@rustbot modify labels: -E-needs-bisection |
@dylni points out this is not actually fixed: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=3dcd3a8a7f8b85cc732d738bf6e57dc2 |
Issue #53738 seems to have regressed.
I tried this code:
I expected to see this happen: No warning should be produced.
Instead, this happened:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: