-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking issue for '_ #48469
Copy link
Copy link
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language teamfinal-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.
Milestone
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language teamfinal-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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 toselffn foo(&self) -> Box<dyn Debug + '_>-- links toself, not quite the same asBox<dyn Debug>'_arounddyn Traitis 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_pathtriggers for theformat!macro #48385 -- triggers forformat!#[warn(single_use_lifetime)]Changes or clarifications to the RFC
The behavior around
dyn Traitis probably worth highlighting, since it is one case where'_differs from writing nothing at all.