Skip to content

Commit 21fab66

Browse files
committed
---
yaml --- r: 178620 b: refs/heads/snap-stage3 c: 92f9476 h: refs/heads/master v: v3
1 parent 86ae9ce commit 21fab66

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3d072a193bfcb76206aab576049e696d6d8db25d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f5281e2bb56fa9ef4debf04e6141d2ad3650ca61
4+
refs/heads/snap-stage3: 92f94765ec2202ccda84a7da97c4d415ffb9b070
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,9 @@ fn check_bare_fn<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
493493
let fcx = check_fn(ccx, fn_ty.unsafety, id, &fn_sig,
494494
decl, id, body, &inh);
495495

496-
vtable::select_all_fcx_obligations_or_error(&fcx);
496+
vtable::select_all_fcx_obligations_and_apply_defaults(&fcx);
497497
upvar::closure_analyze_fn(&fcx, id, decl, body);
498+
vtable::select_all_fcx_obligations_or_error(&fcx);
498499
regionck::regionck_fn(&fcx, id, decl, body);
499500
writeback::resolve_type_vars_in_fn(&fcx, decl, body);
500501
}

branches/snap-stage3/src/librustc_typeck/check/vtable.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,20 @@ fn check_object_type_binds_all_associated_types<'tcx>(tcx: &ty::ctxt<'tcx>,
277277
}
278278
}
279279

280-
pub fn select_all_fcx_obligations_or_error(fcx: &FnCtxt) {
280+
pub fn select_all_fcx_obligations_and_apply_defaults(fcx: &FnCtxt) {
281281
debug!("select_all_fcx_obligations_or_error");
282282

283283
fcx.inh.deferred_resolutions.borrow_mut()
284284
.retain(|r| !r.attempt_resolution(fcx));
285-
286285
select_fcx_obligations_where_possible(fcx);
287286
fcx.default_type_parameters();
287+
select_fcx_obligations_where_possible(fcx);
288+
}
289+
290+
pub fn select_all_fcx_obligations_or_error(fcx: &FnCtxt) {
291+
debug!("select_all_fcx_obligations_or_error");
288292

293+
select_all_fcx_obligations_and_apply_defaults(fcx);
289294
let mut fulfillment_cx = fcx.inh.fulfillment_cx.borrow_mut();
290295
let r = fulfillment_cx.select_all_or_error(fcx.infcx(), fcx);
291296
match r {

0 commit comments

Comments
 (0)