Skip to content

Commit dee0521

Browse files
author
Markus Westerlind
committed
Fix rebase
1 parent 8e6ca04 commit dee0521

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

compiler/rustc_data_structures/src/logged_unification_table.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ where
121121
self.relations().find(vid)
122122
}
123123

124+
pub fn unioned(&mut self, l: I, r: I) -> bool {
125+
let mut relations = self.relations();
126+
relations.find(l) == relations.find(r)
127+
}
128+
124129
pub fn unify_var_value(
125130
&mut self,
126131
vid: I,

compiler/rustc_infer/src/infer/combine.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
229229
target_vid: ty::ConstVid,
230230
ct: &'tcx ty::Const<'tcx>,
231231
vid_is_expected: bool,
232-
vid: ty::ConstVid,
233-
value: &'tcx ty::Const<'tcx>,
234232
) -> RelateResult<'tcx, &'tcx ty::Const<'tcx>> {
235233
let (for_universe, span) = {
236234
let mut inner = self.inner.borrow_mut();
@@ -799,7 +797,7 @@ struct ConstInferUnifier<'cx, 'tcx> {
799797
/// The vid of the const variable that is in the process of being
800798
/// instantiated; if we find this within the const we are folding,
801799
/// that means we would have created a cyclic const.
802-
target_vid: ty::ConstVid<'tcx>,
800+
target_vid: ty::ConstVid,
803801
}
804802

805803
// We use `TypeRelation` here to propagate `RelateResult` upwards.
@@ -934,7 +932,7 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
934932
// an inference variable which is unioned with `target_vid`.
935933
//
936934
// Not doing so can easily result in stack overflows.
937-
if variable_table.unioned(self.target_vid, vid) {
935+
if variable_table.unioned(self.target_vid.into(), vid) {
938936
return Err(TypeError::CyclicConst(c));
939937
}
940938

@@ -949,7 +947,7 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
949947
origin: var_value.origin,
950948
val: ConstVariableValue::Unknown { universe: self.for_universe },
951949
});
952-
Ok(self.tcx().mk_const_var(new_var_id, c.ty))
950+
Ok(self.tcx().mk_const_var(new_var_id.vid, c.ty))
953951
}
954952
}
955953
}

compiler/rustc_typeck/src/check/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,13 @@ impl ItemLikeVisitor<'tcx> for CheckItemTypesVisitor<'tcx> {
11361136
fn visit_impl_item(&mut self, _: &'tcx hir::ImplItem<'tcx>) {}
11371137
}
11381138

1139+
fn typeck_item_bodies(tcx: TyCtxt<'_>, crate_num: CrateNum) {
1140+
debug_assert!(crate_num == LOCAL_CRATE);
1141+
tcx.par_body_owners(|body_owner_def_id| {
1142+
tcx.ensure().typeck(body_owner_def_id);
1143+
});
1144+
}
1145+
11391146
fn fatally_break_rust(sess: &Session) {
11401147
let handler = sess.diagnostic();
11411148
handler.span_bug_no_panic(

0 commit comments

Comments
 (0)