Skip to content

Commit 9bf596b

Browse files
committed
don't pass self.<...> as an argument to a method on the same type...
1 parent 60ade21 commit 9bf596b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/rustc_hir_typeck/src/fallback.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
8585
return false;
8686
}
8787

88-
let diverging_fallback = self
89-
.calculate_diverging_fallback(&unresolved_variables, self.diverging_fallback_behavior);
88+
let diverging_fallback = self.calculate_diverging_fallback(&unresolved_variables);
9089

9190
// We do fallback in two passes, to try to generate
9291
// better error messages.
@@ -160,7 +159,6 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
160159
fn calculate_diverging_fallback(
161160
&self,
162161
unresolved_variables: &[Ty<'tcx>],
163-
behavior: DivergingFallbackBehavior,
164162
) -> UnordMap<Ty<'tcx>, Ty<'tcx>> {
165163
debug!("calculate_diverging_fallback({:?})", unresolved_variables);
166164

@@ -222,7 +220,6 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
222220
let unsafe_infer_vars = OnceCell::new();
223221

224222
self.lint_obligations_broken_by_never_type_fallback_change(
225-
behavior,
226223
&diverging_vids,
227224
&coercion_graph,
228225
);
@@ -241,7 +238,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
241238
diverging_fallback.insert(diverging_ty, ty);
242239
};
243240

244-
match behavior {
241+
match self.diverging_fallback_behavior {
245242
DivergingFallbackBehavior::ToUnit => {
246243
debug!("fallback to () - legacy: {:?}", diverging_vid);
247244
fallback_to(self.tcx.types.unit);
@@ -314,11 +311,10 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
314311

315312
fn lint_obligations_broken_by_never_type_fallback_change(
316313
&self,
317-
behavior: DivergingFallbackBehavior,
318314
diverging_vids: &[ty::TyVid],
319315
coercions: &VecGraph<ty::TyVid, true>,
320316
) {
321-
let DivergingFallbackBehavior::ToUnit = behavior else { return };
317+
let DivergingFallbackBehavior::ToUnit = self.diverging_fallback_behavior else { return };
322318

323319
// Fallback happens if and only if there are diverging variables
324320
if diverging_vids.is_empty() {

0 commit comments

Comments
 (0)