Skip to content

Commit 26ff7cd

Browse files
committed
---
yaml --- r: 223482 b: refs/heads/beta c: 0f13a3f h: refs/heads/master v: v3
1 parent 8ade9d2 commit 26ff7cd

File tree

9 files changed

+22
-14
lines changed

9 files changed

+22
-14
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: 64f1a59daf4b7b5cbab1730f3b10fb73745d3b5e
26+
refs/heads/beta: 0f13a3f361384c278041c95e9a2ba9975e6cde71
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
@@ -283,7 +283,7 @@ impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
283283

284284
fn check_static_type(&self, e: &ast::Expr) {
285285
let ty = self.tcx.node_id_to_type(e.id);
286-
let infcx = infer::new_infer_ctxt(self.tcx, &self.tcx.tables, None);
286+
let infcx = infer::new_infer_ctxt(self.tcx, &self.tcx.tables, None, false);
287287
let cause = traits::ObligationCause::new(e.span, e.id, traits::SharedStatic);
288288
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
289289
fulfill_cx.register_builtin_bound(&infcx, ty, ty::BoundSync, cause);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ fn resolve_trait_associated_const<'a, 'tcx: 'a>(tcx: &'a ty::ctxt<'tcx>,
10311031
substs: trait_substs });
10321032

10331033
tcx.populate_implementations_for_trait_if_necessary(trait_ref.def_id());
1034-
let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None);
1034+
let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None, false);
10351035

10361036
let mut selcx = traits::SelectionContext::new(&infcx, &infcx.parameter_environment);
10371037
let obligation = traits::Obligation::new(traits::ObligationCause::dummy(),

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
10191019
raw_ty.adjust(self.tcx,
10201020
expr.span,
10211021
expr.id,
1022-
raw_ty,
10231022
adjustment,
10241023
|method_call| self.tables
10251024
.borrow()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub struct FulfillmentContext<'tcx> {
8585
// particular node-id).
8686
region_obligations: NodeMap<Vec<RegionObligation<'tcx>>>,
8787

88-
errors_will_be_reported: bool,
88+
pub errors_will_be_reported: bool,
8989
}
9090

9191
#[derive(Clone)]

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

Lines changed: 12 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 = infcx.fulfillment_cx.borrow_mut();
325+
let mut fulfill_cx = FulfillmentContext::new(false);
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,17 @@ 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 = infcx.fulfillment_cx.borrow_mut();
441+
// FIXME (@jroesch): I'm not sure if this is a bug or not, needs
442+
// further investigation. It appears that by reusing the fulfillment_cx
443+
// here we incur more obligations and later trip an asssertion on
444+
// regionck.rs line 337. The two possibilities I see is that
445+
// normalization is not actually fully happening and we
446+
// have a bug else where or that we are adding a duplicate
447+
// bound into the list causing its size to change. I think
448+
// we should probably land this refactor and then come
449+
// back to this is a follow-up patch.
450+
let mut fulfill_cx = FulfillmentContext::new(false);
451+
// let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
442452

443453
let Normalized { value: normalized_value, obligations } =
444454
project::normalize(selcx, cause, value);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4401,7 +4401,7 @@ impl<'tcx> TyS<'tcx> {
44014401
-> bool
44024402
{
44034403
let tcx = param_env.tcx();
4404-
let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, Some(param_env.clone()));
4404+
let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, Some(param_env.clone()), false);
44054405

44064406
let is_impld = traits::type_known_to_meet_builtin_bound(&infcx, param_env,
44074407
self, bound, span);

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ impl<'a, 'tcx> Inherited<'a, 'tcx> {
295295
-> Inherited<'a, 'tcx> {
296296

297297
Inherited {
298-
// I'm probably screwed here ... more boolean prop ...
299-
infcx: infer::new_infer_ctxt(tcx, tables, Some(param_env), false),
298+
infcx: infer::new_infer_ctxt(tcx, tables, Some(param_env), true),
300299
locals: RefCell::new(NodeMap()),
301300
tables: tables,
302301
fn_sig_map: RefCell::new(NodeMap()),
@@ -316,7 +315,8 @@ impl<'a, 'tcx> Inherited<'a, 'tcx> {
316315
let mut fulfillment_cx = self.infcx.fulfillment_cx.borrow_mut();
317316
assoc::normalize_associated_types_in(&self.infcx,
318317
typer,
319-
&mut *fulfillment_cx, span,
318+
&mut fulfillment_cx,
319+
span,
320320
body_id,
321321
value)
322322
}
@@ -1560,7 +1560,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15601560
let raw_ty = self.infcx().shallow_resolve(raw_ty);
15611561
let resolve_ty = |ty: Ty<'tcx>| self.infcx().resolve_type_vars_if_possible(&ty);
15621562
raw_ty.adjust(self.tcx(), expr.span, expr.id, adjustment, |method_call| {
1563-
.method_map
15641563
self.inh.tables.borrow().method_map.get(&method_call)
15651564
.map(|method| resolve_ty(method.ty))
15661565
})

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

Lines changed: 2 additions & 2 deletions
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 = infcx.fulfillment_cx.borrow_mut();
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);
@@ -633,7 +633,7 @@ pub fn check_coherence(crate_context: &CrateCtxt) {
633633
CoherenceChecker {
634634
crate_context: crate_context,
635635
// XXXJAREDXXX: not sure if the bool is right here?
636-
inference_context: new_infer_ctxt(crate_context.tcx, &crate_context.tcx.tables, None, false),
636+
inference_context: new_infer_ctxt(crate_context.tcx, &crate_context.tcx.tables, None, true),
637637
inherent_impls: RefCell::new(FnvHashMap()),
638638
}.check(crate_context.tcx.map.krate());
639639
unsafety::check(crate_context.tcx);

0 commit comments

Comments
 (0)