Skip to content

Conversation

@JohnTitor
Copy link
Member

@JohnTitor JohnTitor commented Jun 8, 2022

@JohnTitor JohnTitor changed the title Mention `infer_static_outlives_requirements removal Mention infer_static_outlives_requirements removal Jun 8, 2022
@JohnTitor JohnTitor marked this pull request as ready for review June 8, 2022 12:23
@JohnTitor JohnTitor added the T-lang Relevant to the language team, which will review and decide on the RFC. label Jun 8, 2022
@Jules-Bertholet
Copy link
Contributor

@rustbot label not-rfc

@rustbot rustbot added the not-rfc For PRs that fix things like spelling mistakes, wrong file names, etc. label May 31, 2023
@Urgau
Copy link
Member

Urgau commented Nov 3, 2025

We discussed this pull request during @rust-lang/internal-sites triage of non-RFC PRs in #t-internal-sites > Stale non-RFC PRs @ 💬.

We consider that while this PR is not an RFC, it still falls through the responsibility of T-lang. Therefore cc-ing them.

@rustbot labels +T-lang +I-lang-nominated
cc @rust-lang/lang-ops

@rustbot rustbot added the I-lang-nominated Indicates that an issue has been nominated for prioritizing at the next lang team meeting. label Nov 3, 2025
@traviscross traviscross added the P-lang-drag-1 Lang team prioritization drag level 1. label Nov 3, 2025
Comment on lines 6 to 12
# This RFC was previously approved, but part of it later **withdrawn**

To infer `T: 'static` requirements from structs, the `infer_static_outlives_requirements` feature was previously implemented
as part of this RFC, but later removed. For details see the [summary comment].

[summary comment]: https://github.com/rust-lang/rust/issues/54185#issuecomment-1124097663

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# This RFC was previously approved, but part of it later **withdrawn**
To infer `T: 'static` requirements from structs, the `infer_static_outlives_requirements` feature was previously implemented
as part of this RFC, but later removed. For details see the [summary comment].
[summary comment]: https://github.com/rust-lang/rust/issues/54185#issuecomment-1124097663
# This RFC was modified after it was accepted
As implemented, the compiler will automatically add where-clauses of the form `where T: 'x` when (a) `'x` is a lifetime parameter on the struct and (b) the where-clauses are implied by the field types within the struct:
```rust
struct Foo<'x, T>
// where
// T: 'x, <-- added automatically by the compiler
{
r: &'x T
}
```
The RFC originally also covered where-clauses relating to `'static`, but the lang-team opted to limit automatic where-clauses to only apply to named lifetime parameters ([rationale]):
[rationale]: https://github.com/rust-lang/rust/issues/54185#issuecomment-1124097663
```rust
struct Foo<T>
// where
// T: 'static, <-- NOT added automatically by the compiler
{
r: &'static T // ERROR: `T: 'static` required
}
```

I think this is a good PR but I suggest being clear about the delta.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Applied your suggestion in e16cd4e (#3278)

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
@traviscross traviscross added I-lang-radar Items that are on lang's radar and will need eventual work or consideration. and removed I-lang-nominated Indicates that an issue has been nominated for prioritizing at the next lang team meeting. P-lang-drag-1 Lang team prioritization drag level 1. labels Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-lang-radar Items that are on lang's radar and will need eventual work or consideration. not-rfc For PRs that fix things like spelling mistakes, wrong file names, etc. T-lang Relevant to the language team, which will review and decide on the RFC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants