Rollup merge of #104909 - compiler-errors:normalize_opaque_types-is-misleading, r=fee1-dead

Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`

1. The query name is a bit misleading, since it doesn't do any associated type normalization, and
2. since it only takes a predicate list, it sounds a bit more powerful than it actually is.
This commit is contained in:
Guillaume Gomez 2022-11-26 17:47:24 +01:00 committed by GitHub
commit 75352dddf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -2068,8 +2068,8 @@ rustc_queries! {
remap_env_constness
}
query normalize_opaque_types(key: &'tcx ty::List<ty::Predicate<'tcx>>) -> &'tcx ty::List<ty::Predicate<'tcx>> {
desc { "normalizing opaque types in `{:?}`", key }
query reveal_opaque_types_in_bounds(key: &'tcx ty::List<ty::Predicate<'tcx>>) -> &'tcx ty::List<ty::Predicate<'tcx>> {
desc { "revealing opaque types in `{:?}`", key }
}
query limits(key: ()) -> Limits {

View File

@ -1747,7 +1747,7 @@ impl<'tcx> ParamEnv<'tcx> {
}
ParamEnv::new(
tcx.normalize_opaque_types(self.caller_bounds()),
tcx.reveal_opaque_types_in_bounds(self.caller_bounds()),
Reveal::All,
self.constness(),
)

View File

@ -1248,9 +1248,9 @@ where
#[derive(Copy, Clone, Debug, HashStable, TyEncodable, TyDecodable)]
pub struct AlwaysRequiresDrop;
/// Normalizes all opaque types in the given value, replacing them
/// Reveals all opaque types in the given value, replacing them
/// with their underlying types.
pub fn normalize_opaque_types<'tcx>(
pub fn reveal_opaque_types_in_bounds<'tcx>(
tcx: TyCtxt<'tcx>,
val: &'tcx ty::List<ty::Predicate<'tcx>>,
) -> &'tcx ty::List<ty::Predicate<'tcx>> {
@ -1287,7 +1287,7 @@ pub fn is_intrinsic(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
pub fn provide(providers: &mut ty::query::Providers) {
*providers = ty::query::Providers {
normalize_opaque_types,
reveal_opaque_types_in_bounds,
is_doc_hidden,
is_doc_notable_trait,
is_intrinsic,