Skip to content

Commit 75352dd

Browse files
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.
2 parents e6c83d9 + 6b63d6c commit 75352dd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: compiler/rustc_middle/src/query/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2068,8 +2068,8 @@ rustc_queries! {
20682068
remap_env_constness
20692069
}
20702070

2071-
query normalize_opaque_types(key: &'tcx ty::List<ty::Predicate<'tcx>>) -> &'tcx ty::List<ty::Predicate<'tcx>> {
2072-
desc { "normalizing opaque types in `{:?}`", key }
2071+
query reveal_opaque_types_in_bounds(key: &'tcx ty::List<ty::Predicate<'tcx>>) -> &'tcx ty::List<ty::Predicate<'tcx>> {
2072+
desc { "revealing opaque types in `{:?}`", key }
20732073
}
20742074

20752075
query limits(key: ()) -> Limits {

Diff for: compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ impl<'tcx> ParamEnv<'tcx> {
17471747
}
17481748

17491749
ParamEnv::new(
1750-
tcx.normalize_opaque_types(self.caller_bounds()),
1750+
tcx.reveal_opaque_types_in_bounds(self.caller_bounds()),
17511751
Reveal::All,
17521752
self.constness(),
17531753
)

Diff for: compiler/rustc_middle/src/ty/util.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,9 @@ where
12481248
#[derive(Copy, Clone, Debug, HashStable, TyEncodable, TyDecodable)]
12491249
pub struct AlwaysRequiresDrop;
12501250

1251-
/// Normalizes all opaque types in the given value, replacing them
1251+
/// Reveals all opaque types in the given value, replacing them
12521252
/// with their underlying types.
1253-
pub fn normalize_opaque_types<'tcx>(
1253+
pub fn reveal_opaque_types_in_bounds<'tcx>(
12541254
tcx: TyCtxt<'tcx>,
12551255
val: &'tcx ty::List<ty::Predicate<'tcx>>,
12561256
) -> &'tcx ty::List<ty::Predicate<'tcx>> {
@@ -1287,7 +1287,7 @@ pub fn is_intrinsic(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
12871287

12881288
pub fn provide(providers: &mut ty::query::Providers) {
12891289
*providers = ty::query::Providers {
1290-
normalize_opaque_types,
1290+
reveal_opaque_types_in_bounds,
12911291
is_doc_hidden,
12921292
is_doc_notable_trait,
12931293
is_intrinsic,

0 commit comments

Comments
 (0)