Revert "Rollup merge of #135914 - compiler-errors:vanquish-query-norm, r=jackh726"
This reverts commit556d901c36
, reversing changes made tobe15391703
.
This commit is contained in:
parent
8231e8599e
commit
4e3e91555c
4 changed files with 36 additions and 36 deletions
|
@ -6,7 +6,8 @@ use rustc_span::{DUMMY_SP, Span};
|
|||
use tracing::{debug, instrument};
|
||||
|
||||
use crate::traits::query::NoSolution;
|
||||
use crate::traits::{ObligationCause, ObligationCtxt};
|
||||
use crate::traits::query::normalize::QueryNormalizeExt;
|
||||
use crate::traits::{Normalized, ObligationCause, ObligationCtxt};
|
||||
|
||||
/// This returns true if the type `ty` is "trivial" for
|
||||
/// dropck-outlives -- that is, if it doesn't require any types to
|
||||
|
@ -171,18 +172,13 @@ pub fn compute_dropck_outlives_inner<'tcx>(
|
|||
// do not themselves define a destructor", more or less. We have
|
||||
// to push them onto the stack to be expanded.
|
||||
for ty in constraints.dtorck_types.drain(..) {
|
||||
let normalized_ty = ocx.normalize(&cause, param_env, ty);
|
||||
let Normalized { value: ty, obligations } =
|
||||
ocx.infcx.at(&cause, param_env).query_normalize(ty)?;
|
||||
ocx.register_obligations(obligations);
|
||||
|
||||
let errors = ocx.select_where_possible();
|
||||
if !errors.is_empty() {
|
||||
debug!("failed to normalize dtorck type: {ty} ~> {errors:#?}");
|
||||
return Err(NoSolution);
|
||||
}
|
||||
debug!("dropck_outlives: ty from dtorck_types = {:?}", ty);
|
||||
|
||||
let normalized_ty = ocx.infcx.resolve_vars_if_possible(normalized_ty);
|
||||
debug!("dropck_outlives: ty from dtorck_types = {:?}", normalized_ty);
|
||||
|
||||
match normalized_ty.kind() {
|
||||
match ty.kind() {
|
||||
// All parameters live for the duration of the
|
||||
// function.
|
||||
ty::Param(..) => {}
|
||||
|
@ -190,12 +186,12 @@ pub fn compute_dropck_outlives_inner<'tcx>(
|
|||
// A projection that we couldn't resolve - it
|
||||
// might have a destructor.
|
||||
ty::Alias(..) => {
|
||||
result.kinds.push(normalized_ty.into());
|
||||
result.kinds.push(ty.into());
|
||||
}
|
||||
|
||||
_ => {
|
||||
if ty_set.insert(normalized_ty) {
|
||||
ty_stack.push((normalized_ty, depth + 1));
|
||||
if ty_set.insert(ty) {
|
||||
ty_stack.push((ty, depth + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue