Skip to content

Commit f05e16a

Browse files
authored
Rollup merge of rust-lang#119337 - mu001999:dead_code/clean, r=WaffleLapkin
Remove dead codes Detected by rust-lang#118257
2 parents d6382c7 + 3386783 commit f05e16a

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

compiler/rustc_infer/src/infer/relate/combine.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl<'tcx> InferCtxt<'tcx> {
335335
// constants and generic expressions are not yet handled correctly.
336336
let Generalization { value_may_be_infer: value, needs_wf: _ } = generalize::generalize(
337337
self,
338-
&mut CombineDelegate { infcx: self, span, param_env },
338+
&mut CombineDelegate { infcx: self, span },
339339
ct,
340340
target_vid,
341341
ty::Variance::Invariant,
@@ -454,11 +454,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
454454
// adding constraints like `'x: '?2` and `?1 <: ?3`.)
455455
let Generalization { value_may_be_infer: b_ty, needs_wf } = generalize::generalize(
456456
self.infcx,
457-
&mut CombineDelegate {
458-
infcx: self.infcx,
459-
param_env: self.param_env,
460-
span: self.trace.span(),
461-
},
457+
&mut CombineDelegate { infcx: self.infcx, span: self.trace.span() },
462458
a_ty,
463459
b_vid,
464460
ambient_variance,

compiler/rustc_infer/src/infer/relate/generalize.rs

-11
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ pub fn generalize<'tcx, D: GeneralizerDelegate<'tcx>, T: Into<Term<'tcx>> + Rela
5555
/// Abstracts the handling of region vars between HIR and MIR/NLL typechecking
5656
/// in the generalizer code.
5757
pub trait GeneralizerDelegate<'tcx> {
58-
fn param_env(&self) -> ty::ParamEnv<'tcx>;
59-
6058
fn forbid_inference_vars() -> bool;
6159

6260
fn span(&self) -> Span;
@@ -66,15 +64,10 @@ pub trait GeneralizerDelegate<'tcx> {
6664

6765
pub struct CombineDelegate<'cx, 'tcx> {
6866
pub infcx: &'cx InferCtxt<'tcx>,
69-
pub param_env: ty::ParamEnv<'tcx>,
7067
pub span: Span,
7168
}
7269

7370
impl<'tcx> GeneralizerDelegate<'tcx> for CombineDelegate<'_, 'tcx> {
74-
fn param_env(&self) -> ty::ParamEnv<'tcx> {
75-
self.param_env
76-
}
77-
7871
fn forbid_inference_vars() -> bool {
7972
false
8073
}
@@ -95,10 +88,6 @@ impl<'tcx, T> GeneralizerDelegate<'tcx> for T
9588
where
9689
T: TypeRelatingDelegate<'tcx>,
9790
{
98-
fn param_env(&self) -> ty::ParamEnv<'tcx> {
99-
<Self as TypeRelatingDelegate<'tcx>>::param_env(self)
100-
}
101-
10291
fn forbid_inference_vars() -> bool {
10392
<Self as TypeRelatingDelegate<'tcx>>::forbid_inference_vars()
10493
}

0 commit comments

Comments
 (0)