Skip to content

Commit d0ef166

Browse files
committed
Clarify and improve comment, removing a TODO.
1 parent f58a1bf commit d0ef166

File tree

1 file changed

+7
-6
lines changed
  • src/librustc_typeck/check

1 file changed

+7
-6
lines changed

src/librustc_typeck/check/mod.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1891,12 +1891,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18911891

18921892
impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> {
18931893
fn object_lifetime_default(&self, span: Span) -> Option<ty::Region> {
1894-
// TODO. RFC #599 specifies that object lifetime defaults take
1895-
// precedence over other defaults. *However,* within a fn
1896-
// body, we typically use inference to allow users to elide
1897-
// lifetimes whenever they like, and then just infer it to
1898-
// whatever it must be. So I interpret that as applying only
1899-
// to fn sigs.
1894+
// RFC #599 specifies that object lifetime defaults take
1895+
// precedence over other defaults. But within a fn body we
1896+
// don't have a *default* region, rather we use inference to
1897+
// find the *correct* region, which is strictly more general
1898+
// (and anyway, within a fn body the right region may not even
1899+
// be something the user can write explicitly, since it might
1900+
// be some expression).
19001901
Some(self.infcx().next_region_var(infer::MiscVariable(span)))
19011902
}
19021903

0 commit comments

Comments
 (0)