Skip to content

Commit 390ee7f

Browse files
committed
Fix rebase fallout from so-called "existential types"
1 parent 1f11ceb commit 390ee7f

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/librustc/infer/error_reporting/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
672672
let mut num_supplied_defaults = 0;
673673
let mut type_params = generics.params.iter().rev().filter_map(|param| match param.kind {
674674
ty::GenericParamDefKind::Lifetime => None,
675-
ty::GenericParamDefKind::Type { has_default, .. } => {
676-
Some((param.def_id, has_default))
677-
}
675+
ty::GenericParamDefKind::Type { has_default, .. } => Some((param.def_id, has_default)),
676+
ty::GenericParamDefKind::Const { .. } => None, // FIXME(const_generics): defaults
678677
}).peekable();
679678
let has_default = {
680679
let has_default = type_params.peek().map(|(_, has_default)| has_default);

src/librustc/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
591591
type_variables
592592
.unsolved_variables()
593593
.into_iter()
594-
.map(|t| self.tcx.mk_var(t))
594+
.map(|t| self.tcx.mk_ty_var(t))
595595
.chain(
596596
(0..int_unification_table.len())
597597
.map(|i| ty::IntVid { index: i as u32 })

src/librustc/middle/resolve_lifetime.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,10 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
867867
next_early_index += 1;
868868
None
869869
}
870+
GenericParamKind::Const { .. } => {
871+
next_early_index += 1;
872+
None
873+
}
870874
}).collect();
871875

872876
let scope = Scope::Binder {

src/librustc_typeck/check/wfcheck.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ fn check_existential_types<'a, 'fcx, 'gcx, 'tcx>(
620620
)
621621
.emit();
622622
},
623-
}, // match ty
623+
} // match ty
624624
ty::subst::UnpackedKind::Lifetime(region) => {
625625
let param_span = tcx.def_span(param.def_id);
626626
if let ty::ReStatic = region {
@@ -641,7 +641,11 @@ fn check_existential_types<'a, 'fcx, 'gcx, 'tcx>(
641641
} else {
642642
seen.entry(region).or_default().push(param_span);
643643
}
644-
},
644+
}
645+
ty::subst::UnpackedKind::Const(_) => {
646+
// TODO(const_generics)
647+
unimplemented!()
648+
}
645649
} // match subst
646650
} // for (subst, param)
647651
for (_, spans) in seen {

0 commit comments

Comments
 (0)