-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking issue for '_
#48469
Comments
@rfcbot fcp merge I want to propose that we stabilize |
Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period is now complete. |
was this closed by #49458 ? |
Seems like...yes. |
This is a sub-issue of #44524, tracking the desire to stabilize
'_
(and the lints around its usage).Covered areas
The
'_
can be used anywhere that a region can be elided. It (typically) carries the same meaning as having no region at all. This section summarizes its usage, giving pointers to tests, and also listing known blocking issues.fn foo(x: Ref<'_>)
-- fresh namefn foo(&self) -> Ref<'_>
-- links toself
fn foo(&self) -> Box<dyn Debug + '_>
-- links toself
, not quite the same asBox<dyn Debug>
'_
arounddyn Trait
is wrong #48468fn foo(&self) -> Box<impl Debug + '_>
-- links toself
, not quite the same asBox<impl Debug>
Some areas where elision ought to be supported are not yet:
impl Foo for Ref<'_>
-- not yet implemented, this is Tracking issue for lifetime elision for impl headers (feature impl_header_lifetime_elision) #15872where T: Trait<'_>
-- not yet implemented, this is enable elision in where-clauses on functions #45667There are also several linted scenarios to nudge the user in the right direction:
Ref
) is deprecated, preferRef<'_>
#[warn(elided_lifetimes_in_paths)]
elided_lifetime_in_path
triggers for theformat!
macro #48385 -- triggers forformat!
#[warn(single_use_lifetime)]
Changes or clarifications to the RFC
The behavior around
dyn Trait
is probably worth highlighting, since it is one case where'_
differs from writing nothing at all.The text was updated successfully, but these errors were encountered: