Skip to content

Commit b7d3c5f

Browse files
Rename normalize to normalize_internal, remove unnecessary usages
1 parent 63c147f commit b7d3c5f

File tree

7 files changed

+6
-7
lines changed

7 files changed

+6
-7
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14911491
}
14921492
}
14931493
} else if self.tcx.features().generic_const_exprs {
1494-
ct.normalize(self.tcx, self.param_env)
1494+
ct.normalize_internal(self.tcx, self.param_env)
14951495
} else {
14961496
ct
14971497
}

compiler/rustc_middle/src/mir/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::fmt::{self, Debug, Display, Formatter};
22

3+
use either::Either;
34
use rustc_hir::def_id::DefId;
45
use rustc_macros::{HashStable, Lift, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
56
use rustc_session::RemapFileNameExt;
67
use rustc_session::config::RemapPathScopeComponents;
78
use rustc_span::{DUMMY_SP, Span};
89
use rustc_target::abi::{HasDataLayout, Size};
9-
use either::Either;
1010

1111
use crate::mir::interpret::{AllocId, ConstAllocation, ErrorHandled, Scalar, alloc_range};
1212
use crate::mir::{Promoted, pretty_print_const_value};

compiler/rustc_middle/src/ty/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl<'tcx> Const<'tcx> {
400400

401401
/// Normalizes the constant to a value or an error if possible.
402402
#[inline]
403-
pub fn normalize(self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> Self {
403+
pub fn normalize_internal(self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> Self {
404404
match self.eval_valtree(tcx, param_env, DUMMY_SP) {
405405
Ok((ty, val)) => Self::new_value(tcx, val, ty),
406406
Err(Either::Left(_bad_ty)) => {

compiler/rustc_symbol_mangling/src/v0.rs

-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
555555

556556
fn print_const(&mut self, ct: ty::Const<'tcx>) -> Result<(), PrintError> {
557557
// We only mangle a typed value if the const can be evaluated.
558-
let ct = ct.normalize(self.tcx, ty::ParamEnv::reveal_all());
559558
let (ct_ty, valtree) = match ct.kind() {
560559
ty::ConstKind::Value(ty, val) => (ty, val),
561560

compiler/rustc_trait_selection/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub fn normalize_param_env_or_error<'tcx>(
368368
// should actually be okay since without `feature(generic_const_exprs)` the only
369369
// const arguments that have a non-empty param env are array repeat counts. These
370370
// do not appear in the type system though.
371-
c.normalize(self.0, ty::ParamEnv::empty())
371+
c.normalize_internal(self.0, ty::ParamEnv::empty())
372372
}
373373
}
374374

compiler/rustc_trait_selection/src/traits/normalize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
413413
self.selcx.infcx,
414414
&mut self.universes,
415415
constant,
416-
|constant| constant.normalize(tcx, self.param_env),
416+
|constant| constant.normalize_internal(tcx, self.param_env),
417417
)
418418
}
419419
}

compiler/rustc_trait_selection/src/traits/query/normalize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'a, 'tcx> {
338338
self.infcx,
339339
&mut self.universes,
340340
constant,
341-
|constant| constant.normalize(self.infcx.tcx, self.param_env),
341+
|constant| constant.normalize_internal(self.infcx.tcx, self.param_env),
342342
);
343343
debug!(?constant, ?self.param_env);
344344
constant.try_super_fold_with(self)

0 commit comments

Comments
 (0)