review
This commit is contained in:
parent
ef6100e846
commit
c10ad0d888
@ -197,6 +197,10 @@ pub struct Body<'tcx> {
|
|||||||
/// let _ = [0; std::mem::size_of::<*mut T>()];
|
/// let _ = [0; std::mem::size_of::<*mut T>()];
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// **WARNING**: Do not change this flags after the MIR was originally created, even if an optimization
|
||||||
|
/// removed the last mention of all generic params. We do not want to rely on optimizations and
|
||||||
|
/// potentially allow things like `[u8; std::mem::size_of::<T>() * 0]` due to this.
|
||||||
pub is_polymorphic: bool,
|
pub is_polymorphic: bool,
|
||||||
|
|
||||||
predecessor_cache: PredecessorCache,
|
predecessor_cache: PredecessorCache,
|
||||||
|
@ -459,17 +459,16 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ty::PredicateAtom::ConstEvaluatable(def_id, substs) => {
|
ty::PredicateAtom::ConstEvaluatable(def_id, substs) => {
|
||||||
const_evaluatable::is_const_evaluatable(
|
match const_evaluatable::is_const_evaluatable(
|
||||||
self.selcx.infcx(),
|
self.selcx.infcx(),
|
||||||
def_id,
|
def_id,
|
||||||
substs,
|
substs,
|
||||||
obligation.param_env,
|
obligation.param_env,
|
||||||
obligation.cause.span,
|
obligation.cause.span,
|
||||||
)
|
) {
|
||||||
.map_or_else(
|
Ok(()) => ProcessResult::Changed(vec![]),
|
||||||
|e| ProcessResult::Error(CodeSelectionError(ConstEvalFailure(e))),
|
Err(e) => ProcessResult::Error(CodeSelectionError(ConstEvalFailure(e))),
|
||||||
|()| ProcessResult::Changed(vec![]),
|
}
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ty::PredicateAtom::ConstEquate(c1, c2) => {
|
ty::PredicateAtom::ConstEquate(c1, c2) => {
|
||||||
|
@ -543,18 +543,17 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ty::PredicateAtom::ConstEvaluatable(def_id, substs) => {
|
ty::PredicateAtom::ConstEvaluatable(def_id, substs) => {
|
||||||
const_evaluatable::is_const_evaluatable(
|
match const_evaluatable::is_const_evaluatable(
|
||||||
self.infcx,
|
self.infcx,
|
||||||
def_id,
|
def_id,
|
||||||
substs,
|
substs,
|
||||||
obligation.param_env,
|
obligation.param_env,
|
||||||
obligation.cause.span,
|
obligation.cause.span,
|
||||||
)
|
) {
|
||||||
.map(|()| EvaluatedToOk)
|
Ok(()) => Ok(EvaluatedToOk),
|
||||||
.or_else(|e| match e {
|
Err(ErrorHandled::TooGeneric) => Ok(EvaluatedToAmbig),
|
||||||
ErrorHandled::TooGeneric => Ok(EvaluatedToAmbig),
|
Err(_) => Ok(EvaluatedToErr),
|
||||||
_ => Ok(EvaluatedToErr),
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ty::PredicateAtom::ConstEquate(c1, c2) => {
|
ty::PredicateAtom::ConstEquate(c1, c2) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user