File tree 1 file changed +3
-2
lines changed
src/tools/clippy/clippy_utils/src/ty/type_certainty
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,8 @@ fn path_segment_certainty(
207
207
// Checking `res_generics_def_id(..)` before calling `generics_of` avoids an ICE.
208
208
if cx. tcx . res_generics_def_id ( path_segment. res ) . is_some ( ) {
209
209
let generics = cx. tcx . generics_of ( def_id) ;
210
- let lhs = if ( parent_certainty. is_certain ( ) || generics. parent_count == 0 ) && generics. params . is_empty ( )
210
+ let count = generics. params . len ( ) - generics. host_effect_index . is_some ( ) as usize ;
211
+ let lhs = if ( parent_certainty. is_certain ( ) || generics. parent_count == 0 ) && count == 0
211
212
{
212
213
Certainty :: Certain ( None )
213
214
} else {
@@ -299,7 +300,7 @@ fn type_is_inferrable_from_arguments(cx: &LateContext<'_>, expr: &Expr<'_>) -> b
299
300
300
301
// Check that all type parameters appear in the functions input types.
301
302
( 0 ..( generics. parent_count + generics. params . len ( ) ) as u32 ) . all ( |index| {
302
- fn_sig
303
+ Some ( index as usize ) == generics . host_effect_index || fn_sig
303
304
. inputs ( )
304
305
. iter ( )
305
306
. any ( |input_ty| contains_param ( * input_ty. skip_binder ( ) , index) )
You can’t perform that action at this time.
0 commit comments