Skip to content

Commit 38bbcc0

Browse files
Rename normalize to normalize_internal, remove unnecessary usages
1 parent e83e4e8 commit 38bbcc0

7 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14871487
}
14881488
}
14891489
}elseifself.tcx.features().generic_const_exprs{
1490-
ct.normalize(self.tcx,self.param_env)
1490+
ct.normalize_internal(self.tcx,self.param_env)
14911491
}else{
14921492
ct
14931493
}

‎compiler/rustc_middle/src/mir/consts.rs‎

Lines changed: 1 addition & 1 deletion
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
usecrate::mir::interpret::{AllocId,ConstAllocation,ErrorHandled,Scalar, alloc_range};
1212
usecrate::mir::{Promoted, pretty_print_const_value};

‎compiler/rustc_middle/src/ty/consts.rs‎

Lines changed: 1 addition & 1 deletion
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-
pubfnnormalize(self,tcx:TyCtxt<'tcx>,param_env:ParamEnv<'tcx>) -> Self{
403+
pubfnnormalize_internal(self,tcx:TyCtxt<'tcx>,param_env:ParamEnv<'tcx>) -> Self{
404404
matchself.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‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
555555

556556
fnprint_const(&mutself,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‎

Lines changed: 1 addition & 1 deletion
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‎

Lines changed: 1 addition & 1 deletion
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
&mutself.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‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'a, 'tcx> {
340340
self.infcx,
341341
&mutself.universes,
342342
constant,
343-
|constant| constant.normalize(self.infcx.tcx,self.param_env),
343+
|constant| constant.normalize_internal(self.infcx.tcx,self.param_env),
344344
);
345345
debug!(?constant, ?self.param_env);
346346
constant.try_super_fold_with(self)

0 commit comments

Comments
 (0)