Reformat using the new identifier sorting from rustfmt
This commit is contained in:
parent
1173204b36
commit
c682aa162b
1455 changed files with 7152 additions and 8384 deletions
|
@ -11,7 +11,7 @@ use rustc_infer::traits::solve::Goal;
|
|||
use rustc_infer::traits::{ObligationCause, Reveal};
|
||||
use rustc_middle::ty::fold::TypeFoldable;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt as _};
|
||||
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
|
||||
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
|
||||
use rustc_type_ir::solve::{Certainty, NoSolution, SolverMode};
|
||||
use tracing::trace;
|
||||
|
||||
|
@ -182,10 +182,10 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
|
|||
}
|
||||
|
||||
fn inject_new_hidden_type_unchecked(&self, key: ty::OpaqueTypeKey<'tcx>, hidden_ty: Ty<'tcx>) {
|
||||
self.0.inject_new_hidden_type_unchecked(
|
||||
key,
|
||||
ty::OpaqueHiddenType { ty: hidden_ty, span: DUMMY_SP },
|
||||
)
|
||||
self.0.inject_new_hidden_type_unchecked(key, ty::OpaqueHiddenType {
|
||||
ty: hidden_ty,
|
||||
span: DUMMY_SP,
|
||||
})
|
||||
}
|
||||
|
||||
fn reset_opaque_types(&self) {
|
||||
|
|
|
@ -15,9 +15,9 @@ use rustc_middle::ty::{self, TyCtxt};
|
|||
use rustc_next_trait_solver::solve::{GenerateProofTree, SolverDelegateEvalExt as _};
|
||||
use tracing::instrument;
|
||||
|
||||
use super::Certainty;
|
||||
use super::delegate::SolverDelegate;
|
||||
use super::inspect::{self, ProofTreeInferCtxtExt, ProofTreeVisitor};
|
||||
use super::Certainty;
|
||||
use crate::traits::{FulfillmentError, FulfillmentErrorCode, ScrubbedTraitError};
|
||||
|
||||
/// A trait engine using the new trait solver.
|
||||
|
@ -347,10 +347,10 @@ fn find_best_leaf_obligation<'tcx>(
|
|||
) -> PredicateObligation<'tcx> {
|
||||
let obligation = infcx.resolve_vars_if_possible(obligation.clone());
|
||||
infcx
|
||||
.visit_proof_tree(
|
||||
obligation.clone().into(),
|
||||
&mut BestObligation { obligation: obligation.clone(), consider_ambiguities },
|
||||
)
|
||||
.visit_proof_tree(obligation.clone().into(), &mut BestObligation {
|
||||
obligation: obligation.clone(),
|
||||
consider_ambiguities,
|
||||
})
|
||||
.break_value()
|
||||
.unwrap_or(obligation)
|
||||
}
|
||||
|
|
|
@ -15,14 +15,14 @@ use rustc_ast_ir::try_visit;
|
|||
use rustc_ast_ir::visit::VisitorResult;
|
||||
use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, InferOk};
|
||||
use rustc_macros::extension;
|
||||
use rustc_middle::traits::solve::{Certainty, Goal, GoalSource, NoSolution, QueryResult};
|
||||
use rustc_middle::traits::ObligationCause;
|
||||
use rustc_middle::traits::solve::{Certainty, Goal, GoalSource, NoSolution, QueryResult};
|
||||
use rustc_middle::ty::{TyCtxt, TypeFoldable};
|
||||
use rustc_middle::{bug, ty};
|
||||
use rustc_next_trait_solver::resolve::EagerResolver;
|
||||
use rustc_next_trait_solver::solve::inspect::{self, instantiate_canonical_state};
|
||||
use rustc_next_trait_solver::solve::{GenerateProofTree, MaybeCause, SolverDelegateEvalExt as _};
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
use rustc_span::{DUMMY_SP, Span};
|
||||
use tracing::instrument;
|
||||
|
||||
use crate::solve::delegate::SolverDelegate;
|
||||
|
|
|
@ -3,8 +3,8 @@ use std::fmt::Debug;
|
|||
use std::marker::PhantomData;
|
||||
|
||||
use rustc_data_structures::stack::ensure_sufficient_stack;
|
||||
use rustc_infer::infer::at::At;
|
||||
use rustc_infer::infer::InferCtxt;
|
||||
use rustc_infer::infer::at::At;
|
||||
use rustc_infer::traits::{FromSolverError, Obligation, TraitEngine};
|
||||
use rustc_middle::traits::ObligationCause;
|
||||
use rustc_middle::ty::{
|
||||
|
@ -14,8 +14,8 @@ use rustc_middle::ty::{
|
|||
use tracing::instrument;
|
||||
|
||||
use super::{FulfillmentCtxt, NextSolverError};
|
||||
use crate::error_reporting::traits::OverflowCause;
|
||||
use crate::error_reporting::InferCtxtErrorExt;
|
||||
use crate::error_reporting::traits::OverflowCause;
|
||||
use crate::traits::query::evaluate_obligation::InferCtxtExt;
|
||||
use crate::traits::{BoundVarReplacer, PlaceholderReplacer, ScrubbedTraitError};
|
||||
|
||||
|
@ -130,12 +130,11 @@ where
|
|||
self.depth += 1;
|
||||
|
||||
let new_infer_ct = infcx.next_const_var(self.at.cause.span);
|
||||
let obligation = Obligation::new(
|
||||
tcx,
|
||||
self.at.cause.clone(),
|
||||
self.at.param_env,
|
||||
ty::NormalizesTo { alias: uv.into(), term: new_infer_ct.into() },
|
||||
);
|
||||
let obligation =
|
||||
Obligation::new(tcx, self.at.cause.clone(), self.at.param_env, ty::NormalizesTo {
|
||||
alias: uv.into(),
|
||||
term: new_infer_ct.into(),
|
||||
});
|
||||
|
||||
let result = if infcx.predicate_may_hold(&obligation) {
|
||||
self.fulfill_cx.register_predicate_obligation(infcx, obligation);
|
||||
|
@ -253,20 +252,20 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for DeeplyNormalizeForDiagnosticsFolder<'_,
|
|||
}
|
||||
|
||||
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
|
||||
deeply_normalize_with_skipped_universes(
|
||||
self.at,
|
||||
ty,
|
||||
vec![None; ty.outer_exclusive_binder().as_usize()],
|
||||
)
|
||||
deeply_normalize_with_skipped_universes(self.at, ty, vec![
|
||||
None;
|
||||
ty.outer_exclusive_binder()
|
||||
.as_usize()
|
||||
])
|
||||
.unwrap_or_else(|_: Vec<ScrubbedTraitError<'tcx>>| ty.super_fold_with(self))
|
||||
}
|
||||
|
||||
fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> {
|
||||
deeply_normalize_with_skipped_universes(
|
||||
self.at,
|
||||
ct,
|
||||
vec![None; ct.outer_exclusive_binder().as_usize()],
|
||||
)
|
||||
deeply_normalize_with_skipped_universes(self.at, ct, vec![
|
||||
None;
|
||||
ct.outer_exclusive_binder()
|
||||
.as_usize()
|
||||
])
|
||||
.unwrap_or_else(|_: Vec<ScrubbedTraitError<'tcx>>| ct.super_fold_with(self))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue