@@ -57,7 +57,7 @@ impl<'tcx> NeverCompatHandler<'tcx> {
57
57
if fcx. infcx . unresolved_type_vars ( fn_substs) . is_some ( ) {
58
58
for subst in fn_substs. types ( ) {
59
59
let mut finder = TyVarFinder { infcx : & fcx. infcx , vars : vec ! [ ] } ;
60
- path . ty . fold_with ( & mut finder) ;
60
+ subst . fold_with ( & mut finder) ;
61
61
path. unresolved_vars . push ( finder. vars ) ;
62
62
}
63
63
@@ -124,7 +124,7 @@ impl<'tcx> NeverCompatHandler<'tcx> {
124
124
debug ! ( "Subst is uninhabited: {:?}" , resolved_subst) ;
125
125
if !vars. is_empty ( ) {
126
126
debug ! ( "Found fallback vars: {:?}" , vars) ;
127
- uninhabited_subst = Some ( ( resolved_subst , vars) ) ;
127
+ uninhabited_subst = Some ( vars) ;
128
128
break ;
129
129
} else {
130
130
debug ! ( "No fallback vars" )
@@ -134,7 +134,7 @@ impl<'tcx> NeverCompatHandler<'tcx> {
134
134
}
135
135
}
136
136
137
- if let ( true , Some ( ( subst , vars) ) ) = ( args_inhabited, uninhabited_subst) {
137
+ if let ( true , Some ( vars) ) = ( args_inhabited, uninhabited_subst) {
138
138
debug ! ( "All arguments are inhabited, at least one subst is not inhabited!" ) ;
139
139
140
140
let mut best_diverging_var = None ;
@@ -211,6 +211,7 @@ impl<'tcx> NeverCompatHandler<'tcx> {
211
211
diverging_var_span,
212
212
"... due to this expression evaluating to `!`" ,
213
213
)
214
+ . note ( "If you want the `!` type to be used here, add explicit type annotations" )
214
215
. emit ( ) ;
215
216
}
216
217
}
0 commit comments