File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
clippy_utils/src/ty/type_certainty Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -207,16 +207,7 @@ fn path_segment_certainty(
207207 if cx. tcx . res_generics_def_id ( path_segment. res ) . is_some ( ) {
208208 let generics = cx. tcx . generics_of ( def_id) ;
209209
210- let own_count = generics. own_params . len ( )
211- - usize:: from ( generics. host_effect_index . is_some_and ( |index| {
212- // Check that the host index actually belongs to this resolution.
213- // E.g. for `Add::add`, host_effect_index is `Some(2)`, but it's part of the parent `Add`
214- // trait's generics.
215- // Add params: [Self#0, Rhs#1, host#2] parent_count=0, count=3
216- // Add::add params: [] parent_count=3, count=3
217- // (3..3).contains(&host_effect_index) => false
218- ( generics. parent_count ..generics. count ( ) ) . contains ( & index)
219- } ) ) ;
210+ let own_count = generics. own_params . len ( ) ;
220211 let lhs = if ( parent_certainty. is_certain ( ) || generics. parent_count == 0 ) && own_count == 0 {
221212 Certainty :: Certain ( None )
222213 } else {
@@ -310,8 +301,7 @@ fn type_is_inferable_from_arguments(cx: &LateContext<'_>, expr: &Expr<'_>) -> bo
310301
311302 // Check that all type parameters appear in the functions input types.
312303 ( 0 ..( generics. parent_count + generics. own_params . len ( ) ) as u32 ) . all ( |index| {
313- Some ( index as usize ) == generics. host_effect_index
314- || fn_sig
304+ fn_sig
315305 . inputs ( )
316306 . iter ( )
317307 . any ( |input_ty| contains_param ( * input_ty. skip_binder ( ) , index) )
You can’t perform that action at this time.
0 commit comments