Skip to content

Commit 84917c8

Browse files
committed
Auto merge of #114776 - fee1-dead-contrib:enable-effects-in-libcore, r=oli-obk
Enable effects for libcore ~~r? `@oli-obk~~` forgot you are on vacation, oops
2 parents 823bcb4 + 74573fb commit 84917c8

File tree

1 file changed

+3
-2
lines changed
  • clippy_utils/src/ty/type_certainty

1 file changed

+3
-2
lines changed

clippy_utils/src/ty/type_certainty/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ fn path_segment_certainty(
207207
// Checking `res_generics_def_id(..)` before calling `generics_of` avoids an ICE.
208208
if cx.tcx.res_generics_def_id(path_segment.res).is_some() {
209209
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
211212
{
212213
Certainty::Certain(None)
213214
} else {
@@ -299,7 +300,7 @@ fn type_is_inferrable_from_arguments(cx: &LateContext<'_>, expr: &Expr<'_>) -> b
299300

300301
// Check that all type parameters appear in the functions input types.
301302
(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
303304
.inputs()
304305
.iter()
305306
.any(|input_ty| contains_param(*input_ty.skip_binder(), index))

0 commit comments

Comments
 (0)