Skip to content

Commit f6137da

Browse files
committed
---
yaml --- r: 41600 b: refs/heads/master c: 7b433d0 h: refs/heads/master v: v3
1 parent 909fc23 commit f6137da

File tree

6 files changed

+9
-249
lines changed

6 files changed

+9
-249
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: 0e774de7661df81cf0e5537ef581823fc148fc2a
2+
refs/heads/master: 7b433d098a4a6b9959976633a77041923cef38c3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/librustc/middle/typeck/check/mod.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ pub struct fn_ctxt {
178178
// var_bindings, locals and next_var_id are shared
179179
// with any nested functions that capture the environment
180180
// (and with any functions whose environment is being captured).
181-
182-
// Refers to whichever `self` is in scope, even this fn_ctxt is
183-
// for a nested closure that captures `self`
184-
self_info: Option<self_info>,
181+
self_impl_def_id: Option<ast::def_id>,
185182
ret_ty: ty::t,
186183
// Used by loop bodies that return from the outer function
187184
indirect_ret_ty: Option<ty::t>,
@@ -230,7 +227,7 @@ fn blank_fn_ctxt(ccx: @crate_ctxt, rty: ty::t,
230227
// It's kind of a kludge to manufacture a fake function context
231228
// and statement context, but we might as well do write the code only once
232229
@fn_ctxt {
233-
self_info: None,
230+
self_impl_def_id: None,
234231
ret_ty: rty,
235232
indirect_ret_ty: None,
236233
purity: ast::pure_fn,
@@ -323,7 +320,7 @@ fn check_fn(ccx: @crate_ctxt,
323320
} else { None };
324321

325322
@fn_ctxt {
326-
self_info: self_info,
323+
self_impl_def_id: self_info.map(|self_info| self_info.def_id),
327324
ret_ty: ret_ty,
328325
indirect_ret_ty: indirect_ret_ty,
329326
purity: purity,
@@ -1556,9 +1553,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
15561553

15571554
fcx.write_ty(expr.id, fty);
15581555

1559-
// We inherit the same self info as the enclosing scope,
1560-
// since the function we're checking might capture `self`
1561-
check_fn(fcx.ccx, fcx.self_info, &fn_ty, decl, body,
1556+
check_fn(fcx.ccx, None, &fn_ty, decl, body,
15621557
fn_kind, Some(fcx));
15631558
}
15641559

trunk/src/librustc/middle/typeck/infer/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,16 +737,15 @@ impl infer_ctxt {
737737
fn type_error_message(sp: span, mk_msg: fn(~str) -> ~str,
738738
actual_ty: ty::t, err: Option<&ty::type_err>) {
739739
let actual_ty = self.resolve_type_vars_if_possible(actual_ty);
740-
let mut actual_sty = ty::get(copy actual_ty);
741740

742741
// Don't report an error if actual type is ty_err.
743-
match actual_sty.sty {
742+
match ty::get(actual_ty).sty {
744743
ty::ty_err => return,
745744
// Should really not report an error if the type
746745
// has ty_err anywhere as a component, but that's
747746
// annoying since we haven't written a visitor for
748747
// ty::t yet
749-
ty::ty_fn(ref fty) => match ty::get(fty.sig.output).sty {
748+
ty::ty_fn(fty) => match ty::get(fty.sig.output).sty {
750749
ty::ty_err => return,
751750
_ => ()
752751
},

trunk/src/test/run-pass/issue-3563-2.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

trunk/src/test/run-pass/issue-3563-3.rs

Lines changed: 0 additions & 212 deletions
This file was deleted.

trunk/src/test/compile-fail/issue-3563.rs renamed to trunk/src/test/run-pass/issue-3563.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test
1112
trait A {
1213
fn a(&self) {
13-
|| self.b() //~ ERROR type `&self/self` does not implement any method in scope named `b`
14+
|| self.b()
1415
}
1516
}
16-
fn main() {}

0 commit comments

Comments
 (0)