From d0ef1664ca9bc885724e3a42d3194079ad0cf582 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 12 Feb 2015 13:34:50 -0500 Subject: [PATCH] Clarify and improve comment, removing a TODO. --- src/librustc_typeck/check/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 4c1fd7ea854..828aed8b3ef 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1891,12 +1891,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> { fn object_lifetime_default(&self, span: Span) -> Option { - // TODO. RFC #599 specifies that object lifetime defaults take - // precedence over other defaults. *However,* within a fn - // body, we typically use inference to allow users to elide - // lifetimes whenever they like, and then just infer it to - // whatever it must be. So I interpret that as applying only - // to fn sigs. + // RFC #599 specifies that object lifetime defaults take + // precedence over other defaults. But within a fn body we + // don't have a *default* region, rather we use inference to + // find the *correct* region, which is strictly more general + // (and anyway, within a fn body the right region may not even + // be something the user can write explicitly, since it might + // be some expression). Some(self.infcx().next_region_var(infer::MiscVariable(span))) }