Skip to content
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

fix false negatives in explicit_outlives_requirements #54630

Open
zackmdavis opened this issue Sep 28, 2018 · 1 comment
Open

fix false negatives in explicit_outlives_requirements #54630

zackmdavis opened this issue Sep 28, 2018 · 1 comment
Labels
A-lifetimes Area: Lifetimes / regions A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. L-explicit_outlives_requirements Lint: explicit_outlives_requirements T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@zackmdavis
Copy link
Member

Niko Matsakis points out that the explicit_outlives_requirements lint (from #53013, expected to land soon) should also fire on lifetime-outlives bounds and associated-type-outlives bounds, as illustrated by the following two examples:

struct Foo<'a, 'b: 'a> {
    x: &'a &'b u32
}

struct Bar<'a, T: Iterator> where T::Item: 'a {
    item: &'a T::Item,
}
@zackmdavis zackmdavis added the A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. label Sep 28, 2018
@Enselic Enselic added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Oct 15, 2023
@fmease
Copy link
Member

fmease commented May 14, 2024

We do emit explicit_outlives_requirements for the first case — Foo — (if the lint level is set to at least warn, ofc)but we still don't for the second case — Bar.

@fmease fmease added A-lifetimes Area: Lifetimes / regions L-explicit_outlives_requirements Lint: explicit_outlives_requirements labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. L-explicit_outlives_requirements Lint: explicit_outlives_requirements T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants