Skip to content

Commit

Permalink
Clarify and improve comment, removing a TODO.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Feb 16, 2015
1 parent f58a1bf commit d0ef166
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ty::Region> {
// 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)))
}

Expand Down

0 comments on commit d0ef166

Please sign in to comment.