Skip to content

Commit 8ade9d2

Browse files
committed
---
yaml --- r: 223481 b: refs/heads/beta c: 64f1a59 h: refs/heads/master i: 223479: 524a8f3 v: v3
1 parent 1168073 commit 8ade9d2

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 6947948b4df98b82a9e8f6847db442921edfc37b
26+
refs/heads/beta: 64f1a59daf4b7b5cbab1730f3b10fb73745d3b5e
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
284284
fn check_static_type(&self, e: &ast::Expr) {
285285
let ty = self.tcx.node_id_to_type(e.id);
286286
let infcx = infer::new_infer_ctxt(self.tcx, &self.tcx.tables, None);
287-
let mut fulfill_cx = traits::FulfillmentContext::new(false);
288287
let cause = traits::ObligationCause::new(e.span, e.id, traits::SharedStatic);
288+
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
289289
fulfill_cx.register_builtin_bound(&infcx, ty, ty::BoundSync, cause);
290290
match fulfill_cx.select_all_or_error(&infcx, &infcx.parameter_environment) {
291291
Ok(()) => { },

branches/beta/src/librustc/middle/traits/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ pub fn type_known_to_meet_builtin_bound<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
322322
ty,
323323
bound);
324324

325-
let mut fulfill_cx = FulfillmentContext::new(false);
325+
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
326326

327327
// We can use a dummy node-id here because we won't pay any mind
328328
// to region obligations that arise (there shouldn't really be any
@@ -438,7 +438,8 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
438438
debug!("normalize_param_env(value={:?})", value);
439439

440440
let mut selcx = &mut SelectionContext::new(infcx, closure_typer);
441-
let mut fulfill_cx = FulfillmentContext::new(false);
441+
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
442+
442443
let Normalized { value: normalized_value, obligations } =
443444
project::normalize(selcx, cause, value);
444445
debug!("normalize_param_env: normalized_value={:?} obligations={:?}",

branches/beta/src/librustc_trans/trans/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ pub fn fulfill_obligation<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
994994
// Currently, we use a fulfillment context to completely resolve
995995
// all nested obligations. This is because they can inform the
996996
// inference of the impl's type parameters.
997-
let mut fulfill_cx = traits::FulfillmentContext::new(true);
997+
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
998998
let vtable = selection.map(|predicate| {
999999
fulfill_cx.register_predicate_obligation(&infcx, predicate);
10001000
});
@@ -1019,10 +1019,10 @@ pub fn normalize_and_test_predicates<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
10191019
predicates);
10201020

10211021
let tcx = ccx.tcx();
1022-
let mut infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None, false);
1022+
let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None, false);
10231023
let typer = NormalizingClosureTyper::new(tcx);
10241024
let mut selcx = traits::SelectionContext::new(&infcx, &typer);
1025-
let mut fulfill_cx = traits::FulfillmentContext::new(false);
1025+
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
10261026
let cause = traits::ObligationCause::dummy();
10271027
let traits::Normalized { value: predicates, obligations } =
10281028
traits::normalize(&mut selcx, cause.clone(), &predicates);

branches/beta/src/librustc_trans/trans/monomorphize.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ pub fn normalize_associated_type<'tcx,T>(tcx: &ty::ctxt<'tcx>, value: &T) -> T
335335
result,
336336
obligations);
337337

338-
let mut fulfill_cx = traits::FulfillmentContext::new(true);
338+
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
339+
339340
for obligation in obligations {
340341
fulfill_cx.register_predicate_obligation(&infcx, obligation);
341342
}

branches/beta/src/librustc_typeck/check/compare_method.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn compare_impl_method<'tcx>(tcx: &ty::ctxt<'tcx>,
4444
impl_trait_ref);
4545

4646
let mut infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None, true);
47-
let mut fulfillment_cx = traits::FulfillmentContext::new(true);
47+
let mut fulfillment_cx = infcx.fulfillment_cx.borrow_mut();
4848

4949
let trait_to_impl_substs = &impl_trait_ref.substs;
5050

@@ -420,7 +420,7 @@ pub fn compare_const_impl<'tcx>(tcx: &ty::ctxt<'tcx>,
420420
impl_trait_ref);
421421

422422
let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None, true);
423-
let mut fulfillment_cx = traits::FulfillmentContext::new(true);
423+
let mut fulfillment_cx = infcx.fulfillment_cx.borrow_mut();
424424

425425
// The below is for the most part highly similar to the procedure
426426
// for methods above. It is simpler in many respects, especially

branches/beta/src/librustc_typeck/coherence/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ impl<'a, 'tcx> CoherenceChecker<'a, 'tcx> {
531531
}
532532
};
533533

534-
let mut fulfill_cx = traits::FulfillmentContext::new(true);
534+
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
535535

536536
// Register an obligation for `A: Trait<B>`.
537537
let cause = traits::ObligationCause::misc(span, impl_did.node);

0 commit comments

Comments
 (0)