Handle ConstValue::Placeholder
in canonicalizer
This commit is contained in:
parent
e70797b575
commit
2308d2d68a
@ -454,9 +454,9 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
|
||||
}
|
||||
return self.canonicalize_const_var(
|
||||
CanonicalVarInfo {
|
||||
kind: CanonicalVarKind::Const(ui)
|
||||
kind: CanonicalVarKind::Const(ui),
|
||||
},
|
||||
c
|
||||
c,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -471,6 +471,14 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
|
||||
return c;
|
||||
}
|
||||
}
|
||||
ConstValue::Placeholder(placeholder) => {
|
||||
return self.canonicalize_const_var(
|
||||
CanonicalVarInfo {
|
||||
kind: CanonicalVarKind::PlaceholderConst(placeholder),
|
||||
},
|
||||
c,
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
@ -414,8 +414,17 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
|
||||
CanonicalVarKind::PlaceholderConst(
|
||||
ty::PlaceholderConst { universe, name },
|
||||
) => {
|
||||
let _ = (universe, name);
|
||||
unimplemented!() // FIXME(const_generics)
|
||||
let universe_mapped = universe_map(universe);
|
||||
let placeholder_mapped = ty::PlaceholderConst {
|
||||
universe: universe_mapped,
|
||||
name,
|
||||
};
|
||||
self.tcx.mk_lazy_const(ty::LazyConst::Evaluated(
|
||||
ty::Const {
|
||||
val: ConstValue::Placeholder(placeholder_mapped),
|
||||
ty: self.tcx.types.err, // FIXME(const_generics)
|
||||
}
|
||||
)).into()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user