Skip to content

Commit 492e14b

Browse files
committed
Describe Fix ambiguous cases of multiple & in elided self lifetimes
1 parent 1c03654 commit 492e14b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Language changes in Rust 1.81.0
2626
* No change: unwinding is not specified in the FLS
2727

2828
* `Fix ambiguous cases of multiple `&` in elided self lifetimes. <https://github.com/rust-lang/rust/pull/117967/>`_
29+
30+
* Changed paragraph: :p:`fls_crb6m6b3cdwh`
31+
32+
* New paragraph: :p:`fls_d4u3y82hdadc`
33+
2934
* `Stabilize `#[expect]` for lints (RFC 2383), <https://github.com/rust-lang/rust/pull/120924/>`_ like `#[allow]` with a warning if the lint is _not_ fulfilled.
3035
* `Change method resolution to constrain hidden types instead of rejecting method candidates. <https://github.com/rust-lang/rust/pull/123962/>`_
3136
* `Bump `elided_lifetimes_in_associated_constant` to deny. <https://github.com/rust-lang/rust/pull/124211/>`_

src/types-and-traits.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,6 +3200,10 @@ An :dt:`input lifetime` is one of the following :t:`[lifetime]s`:
32003200
:std:`core::ops::Fn`, :std:`core::ops::FnMut`, and :std:`core::ops::FnOnce`
32013201
:t:`[trait]s`.
32023202

3203+
:dp:`fls_d4u3y82hdadc`
3204+
A :dt:`self input lifetime` is an :t:`input lifetime` of a :t:`self parameter`
3205+
that is a :t:`lifetime` of a :t:`reference type` whose referent is :c:`Self`.
3206+
32033207
* :dp:`fls_ks8wlufmhz6d`
32043208
Any :t:`lifetime` related to an :t:`implementing type` and an
32053209
:t:`implemented trait` of an :t:`implementation`.
@@ -3231,10 +3235,10 @@ An :dt:`output lifetime` is one of the following :t:`[lifetime]s`:
32313235
:t:`lifetime` is assigned to all :t:`elided` :t:`[output lifetime]s`.
32323236

32333237
#. :dp:`fls_crb6m6b3cdwh`
3234-
If a :t:`function` has a :t:`self parameter` of the form ``&self``,
3235-
``&mut self``, or ``self: T`` where ``T`` is a :t:`type` with a
3236-
:t:`lifetime`, then the :t:`lifetime` of the :t:`self parameter` is assigned
3237-
to all :t:`elided` :t:`[output lifetime]s`.
3238+
If a :t:`function` has a :t:`self parameter` with exactly 1
3239+
:t:`self input lifetime`, then the :t:`lifetime` of the
3240+
:t:`self input lifetime` is assigned to all :t:`elided`
3241+
:t:`[output lifetime]s`.
32383242

32393243
#. :dp:`fls_ac9tdlfwp5et`
32403244
Otherwise this is a static error.

0 commit comments

Comments
 (0)