@@ -63,8 +63,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
6363 return false ;
6464 }
6565
66- let diverging_fallback = self
67- . calculate_diverging_fallback ( & unresolved_variables, self . diverging_fallback_behavior ) ;
66+ let diverging_fallback = self . calculate_diverging_fallback ( & unresolved_variables) ;
6867
6968 // We do fallback in two passes, to try to generate
7069 // better error messages.
@@ -138,7 +137,6 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
138137 fn calculate_diverging_fallback (
139138 & self ,
140139 unresolved_variables : & [ Ty < ' tcx > ] ,
141- behavior : DivergingFallbackBehavior ,
142140 ) -> UnordMap < Ty < ' tcx > , Ty < ' tcx > > {
143141 debug ! ( "calculate_diverging_fallback({:?})" , unresolved_variables) ;
144142
@@ -200,7 +198,6 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
200198 let unsafe_infer_vars = OnceCell :: new ( ) ;
201199
202200 self . lint_obligations_broken_by_never_type_fallback_change (
203- behavior,
204201 & diverging_vids,
205202 & coercion_graph,
206203 ) ;
@@ -219,7 +216,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
219216 diverging_fallback. insert ( diverging_ty, ty) ;
220217 } ;
221218
222- match behavior {
219+ match self . diverging_fallback_behavior {
223220 DivergingFallbackBehavior :: ToUnit => {
224221 debug ! ( "fallback to () - legacy: {:?}" , diverging_vid) ;
225222 fallback_to ( self . tcx . types . unit ) ;
@@ -292,11 +289,10 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
292289
293290 fn lint_obligations_broken_by_never_type_fallback_change (
294291 & self ,
295- behavior : DivergingFallbackBehavior ,
296292 diverging_vids : & [ ty:: TyVid ] ,
297293 coercions : & VecGraph < ty:: TyVid , true > ,
298294 ) {
299- let DivergingFallbackBehavior :: ToUnit = behavior else { return } ;
295+ let DivergingFallbackBehavior :: ToUnit = self . diverging_fallback_behavior else { return } ;
300296
301297 // Fallback happens if and only if there are diverging variables
302298 if diverging_vids. is_empty ( ) {
0 commit comments