Skip to content

Commit de1dc63

Browse files
committed
---
yaml --- r: 183634 b: refs/heads/beta c: d0ef166 h: refs/heads/master v: v3
1 parent c90bf41 commit de1dc63

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: f58a1bfa981eee4ba4d4c3c801f94772e4ab0019
34+
refs/heads/beta: d0ef1664ca9bc885724e3a42d3194079ad0cf582
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/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)