Repository navigation
Labels
A-edition-2018Area: The 2018 editionArea: The 2018 editionA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-single_use_lifetimesLint: single_use_lifetimesLint: single_use_lifetimesP-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Issue #53738 seems to have regressed.
I tried this code:
#[deny(single_use_lifetimes)]
#[derive(Eq)]
struct Foo<'a, T> {
/// a reference to the underlying secret data that will be derefed
pub data: &'a mut T,
}I expected to see this happen: No warning should be produced.
Instead, this happened:
error: lifetime parameter `'a` only used once
--> src/lib.rs:4:12
|
3 | #[derive(Eq)]
| -- ...is used only here
4 | struct Foo<'a, T> {
| ^^ this lifetime...
|
note: lint level defined here
--> src/lib.rs:1:8
|
1 | #[deny(single_use_lifetimes)]
| ^^^^^^^^^^^^^^^^^^^^
Meta
rustc --version --verbose:
rustc 1.42.0 (b8cedc004 2020-03-09)
binary: rustc
commit-hash: b8cedc00407a4c56a3bda1ed605c6fc166655447
commit-date: 2020-03-09
host: x86_64-apple-darwin
release: 1.42.0
LLVM version: 9.0
Reacted by Jacob Pratt, EFanZh, Rose Kunkel and wtfsck
Metadata
Metadata
Assignees
Labels
A-edition-2018Area: The 2018 editionArea: The 2018 editionA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-single_use_lifetimesLint: single_use_lifetimesLint: single_use_lifetimesP-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Activity
jonas-schievink commentedon Mar 12, 2020
From what I can tell, the
Eqcase might have never worked, sinceDebugstill doesn't warn (so the linked issue specifically maybe didn't regress, only a closely related example incorrectly warns). This needs confirmation though.cuviper commentedon Mar 12, 2020
It also fails in 1.40 and 1.41.
It gets a different error in 1.39, with
Eqcomplaining thatPartialEqis not implemented, but if you add that then it does compile successfully.[-]Regression of #53738[/-][+]Regression of #53738: spurious single_use_lifetimes warning[/+]spastorino commentedon Mar 18, 2020
@rustbot ping cleanup
2 remaining items
chrissimpkins commentedon Mar 18, 2020
bisect-rustc:
searched nightlies: from nightly-2019-09-01 to nightly-2020-03-10
regressed nightly: nightly-2019-10-28
searched commits: from fae75cd to 95f437b
regressed commit: b7176b4
source code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=4bd9c10c79f908d449f607e5ce69bfa7
Builds without errors as of rustc 1.39.0 and earlier (tested on godbolt)
Error
COLLAPSIBLE ERROR STACKTRACE
spastorino commentedon Mar 20, 2020
cc @pnkfelix , is it a good idea to assign this one to you Felix? regressed here #65519
LeSeulArtichaut commentedon Mar 20, 2020
@rustbot modify labels: -E-needs-bisection
Auto merge of rust-lang#96833 - cjgillot:ast-lifetimes-single, r=petr…
jyn514 commentedon Jun 15, 2022
@dylni points out this is not actually fixed: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=3dcd3a8a7f8b85cc732d738bf6e57dc2
cc @cjgillot
Rollup merge of rust-lang#103089 - cjgillot:automatic-structural-eq, …