Skip to content

ignored lifetime constraints in type annotations #115175

Closed

Description

@aliemjay

The following compiles since the full transition to NLL in v1.63, although it shouldn't:

struct Static<T: 'static>(T);
fn test<T>() {
    let _ = None::<Static<T>>;
}

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 24, 2023
  2. added
    T-compilerRelevant 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.
    A-NLLArea: Non-lexical lifetimes (NLL)
    C-bugCategory: This is a bug.
    NLL-soundWorking towards the "invalid code does not compile" goal
    T-typesRelevant to the types team, which will review and decide on the PR/issue.
    on Aug 24, 2023
  3. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 24, 2023
  4. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 24, 2023
  5. apiraino commented on Aug 25, 2023

    @apiraino
    Contributor

    bisected to

    commit[0] 2022-06-06: Auto merge of #97730 - flip1995:clippyup, r=Manishearth
      commit[1] 2022-06-06: Auto merge of #97809 - matthiaskrgr:rollup-ajyvjd3, r=matthiaskrgr
      commit[2] 2022-06-07: Auto merge of #97801 - RalfJung:miri, r=RalfJung
      commit[3] 2022-06-07: Auto merge of #95565 - jackh726:remove-borrowck-mode, r=nikomatsakis
      commit[4] 2022-06-07: Auto merge of #97512 - scottmcm:add-coldcc, r=nagisa,lcnr
      commit[5] 2022-06-07: Auto merge of #97825 - Dylan-DPC:rollup-ya51k1k, r=Dylan-DPC
      commit[6] 2022-06-07: Auto merge of #97835 - Dylan-DPC:rollup-0ae3pwp, r=Dylan-DPC
    

    closest seems (unsurprisingly) #95565?

  6. apiraino commented on Sep 12, 2023

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion).

    @rustbot label -I-prioritize +P-medium

  7. added and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Sep 12, 2023
  8. lengyijun commented on Oct 21, 2025

    @lengyijun
  9. added
    I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
    and removed
    NLL-soundWorking towards the "invalid code does not compile" goal
    on Nov 11, 2025
  10. moved this to open/unblocked in T-types unsound issueson Nov 11, 2025
  11. theemathas commented on Nov 12, 2025

    @theemathas
    Contributor

    I've managed to cause actual UB based on this weirdness, and filed a separate issue at #148854

  12. added 2 commits that reference this issue on Feb 12, 2026
    3b311a7
    29fa07e
  13. moved this from open/unblocked to new solver everywhere in T-types unsound issueson Feb 14, 2026
  14. moved this from new solver everywhere to Completed in T-types unsound issueson Feb 14, 2026
  15. added a commit that references this issue on Feb 15, 2026
    13963a7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)C-bugCategory: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions