diff options
| author | bors <bors@rust-lang.org> | 2022-11-30 11:13:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-30 11:13:09 +0000 |
| commit | 24606deaf48e56f604a6125fa11fb9f70cf4f1f4 (patch) | |
| tree | c23e72e2e83aa3707dbc86dfeeb4db10a0e032f8 /src | |
| parent | a569a88f5500e8780c7cc65fa53fc8b098517674 (diff) | |
| parent | 1e236acd05c045b186195aa0a0b44657ac039978 (diff) | |
| download | rust-24606deaf48e56f604a6125fa11fb9f70cf4f1f4.tar.gz rust-24606deaf48e56f604a6125fa11fb9f70cf4f1f4.zip | |
Auto merge of #104905 - compiler-errors:normalization-changes, r=spastorino
Some initial normalization method changes 1. Rename `AtExt::normalize` to `QueryNormalizeExt::query_normalize` (using the `QueryNormalizer`) 2. Introduce `NormalizeExt::normalize` to replace `partially_normalize_associated_types_in` (using the `AssocTypeNormalizer`) 3. Rename `FnCtxt::normalize_associated_types_in` to `FnCtxt::normalize` 4. Remove some unused other normalization fns in `Inherited` and `FnCtxt` Also includes one drive-by where we're no longer creating a `FnCtxt` inside of `check_fn`, but passing it in. This means we don't need such weird `FnCtxt` construction logic. Stacked on top of #104835 for convenience. r? types
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 4 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_utils/src/ty.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 42328222fd3..b18788a033f 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1581,14 +1581,14 @@ fn normalize<'tcx>(cx: &mut DocContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> } use crate::rustc_trait_selection::infer::TyCtxtInferExt; - use crate::rustc_trait_selection::traits::query::normalize::AtExt; + use crate::rustc_trait_selection::traits::query::normalize::QueryNormalizeExt; use rustc_middle::traits::ObligationCause; // Try to normalize `<X as Y>::T` to a type let infcx = cx.tcx.infer_ctxt().build(); let normalized = infcx .at(&ObligationCause::dummy(), cx.param_env) - .normalize(ty) + .query_normalize(ty) .map(|resolved| infcx.resolve_vars_if_possible(resolved.value)); match normalized { Ok(normalized_value) => { diff --git a/src/tools/clippy/clippy_utils/src/ty.rs b/src/tools/clippy/clippy_utils/src/ty.rs index f4459e3e663..2ceda3511fe 100644 --- a/src/tools/clippy/clippy_utils/src/ty.rs +++ b/src/tools/clippy/clippy_utils/src/ty.rs @@ -22,7 +22,7 @@ use rustc_span::symbol::Ident; use rustc_span::{sym, Span, Symbol, DUMMY_SP}; use rustc_target::abi::{Size, VariantIdx}; use rustc_trait_selection::infer::InferCtxtExt; -use rustc_trait_selection::traits::query::normalize::AtExt; +use rustc_trait_selection::traits::query::normalize::QueryNormalizeExt; use std::iter; use crate::{match_def_path, path_res, paths}; @@ -283,7 +283,7 @@ fn is_normalizable_helper<'tcx>( cache.insert(ty, false); let infcx = cx.tcx.infer_ctxt().build(); let cause = rustc_middle::traits::ObligationCause::dummy(); - let result = if infcx.at(&cause, param_env).normalize(ty).is_ok() { + let result = if infcx.at(&cause, param_env).query_normalize(ty).is_ok() { match ty.kind() { ty::Adt(def, substs) => def.variants().iter().all(|variant| { variant |
