Skip to content

Commit e60f3e3

Browse files
committed
---
yaml --- r: 180991 b: refs/heads/master c: d0ef166 h: refs/heads/master i: 180989: 02ef361 180987: b3b571d 180983: d91c181 180975: 5f744e9 180959: 190e3fc 180927: c220da6 180863: c07fab6 180735: 72f567a v: v3
1 parent b087e3b commit e60f3e3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f58a1bfa981eee4ba4d4c3c801f94772e4ab0019
2+
refs/heads/master: d0ef1664ca9bc885724e3a42d3194079ad0cf582
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f1bb6c2f46f08c1d7b6d695f5b3cf93142cb8860
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77

trunk/src/librustc_typeck/check/mod.rs

Lines changed: 7 additions & 6 deletions
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)