Handle ConstValue::Placeholder
in canonicalizer
This commit is contained in:
parent
e70797b575
commit
2308d2d68a
2 changed files with 21 additions and 4 deletions
|
@ -454,9 +454,9 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
|
||||||
}
|
}
|
||||||
return self.canonicalize_const_var(
|
return self.canonicalize_const_var(
|
||||||
CanonicalVarInfo {
|
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;
|
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(
|
CanonicalVarKind::PlaceholderConst(
|
||||||
ty::PlaceholderConst { universe, name },
|
ty::PlaceholderConst { universe, name },
|
||||||
) => {
|
) => {
|
||||||
let _ = (universe, name);
|
let universe_mapped = universe_map(universe);
|
||||||
unimplemented!() // FIXME(const_generics)
|
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…
Add table
Add a link
Reference in a new issue