address review
This commit is contained in:
parent
372c4fd67f
commit
bea0a6dc84
4 changed files with 5 additions and 13 deletions
|
@ -1819,7 +1819,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
|||
_ => None,
|
||||
},
|
||||
ConstantKind::Unevaluated(uv, _) => Some(uv),
|
||||
_ => None,
|
||||
ConstantKind::Val(..) => None,
|
||||
};
|
||||
|
||||
if let Some(uv) = maybe_uneval {
|
||||
|
|
|
@ -2062,7 +2062,7 @@ pub enum ConstantKind<'tcx> {
|
|||
/// This constant came from the type system
|
||||
Ty(ty::Const<'tcx>),
|
||||
|
||||
/// An unevaluated constant that cannot go back into the type system.
|
||||
/// An unevaluated mir constant which is not part of the type system.
|
||||
Unevaluated(ty::Unevaluated<'tcx, Option<Promoted>>, Ty<'tcx>),
|
||||
|
||||
/// This constant cannot go back into the type system, as it represents
|
||||
|
|
|
@ -1077,20 +1077,12 @@ macro_rules! visit_place_fns {
|
|||
location,
|
||||
);
|
||||
|
||||
if new_local == local {
|
||||
None
|
||||
} else {
|
||||
Some(PlaceElem::Index(new_local))
|
||||
}
|
||||
if new_local == local { None } else { Some(PlaceElem::Index(new_local)) }
|
||||
}
|
||||
PlaceElem::Field(field, ty) => {
|
||||
let mut new_ty = ty;
|
||||
self.visit_ty(&mut new_ty, TyContext::Location(location));
|
||||
if ty != new_ty {
|
||||
Some(PlaceElem::Field(field, new_ty))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
if ty != new_ty { Some(PlaceElem::Field(field, new_ty)) } else { None }
|
||||
}
|
||||
PlaceElem::Deref
|
||||
| PlaceElem::ConstantIndex { .. }
|
||||
|
|
|
@ -299,7 +299,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
|
|||
let err = ConstEvalErr::new(&self.ecx, error, Some(c.span));
|
||||
if let Some(lint_root) = self.lint_root(source_info) {
|
||||
let lint_only = match c.literal {
|
||||
ConstantKind::Ty(_) => c.literal.needs_subst(),
|
||||
ConstantKind::Ty(ct) => ct.needs_subst(),
|
||||
ConstantKind::Unevaluated(
|
||||
ty::Unevaluated { def: _, substs: _, promoted: Some(_) },
|
||||
_,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue