about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2023-09-22 00:05:45 +0000
committerDeadbeef <ent3rm4n@gmail.com>2023-09-22 00:05:52 +0000
commit74573fbab98fe3eeaef63ada418613bff0a77c62 (patch)
treefb1999fe7d8d22599cb0d2a9cf856e39ca46c821
parentb30cefc775e92892f8d49a649bb09510bbbb79af (diff)
downloadrust-74573fbab98fe3eeaef63ada418613bff0a77c62.tar.gz
rust-74573fbab98fe3eeaef63ada418613bff0a77c62.zip
fix clippy errors (ignore effects in certainty)
-rw-r--r--clippy_utils/src/ty/type_certainty/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/clippy_utils/src/ty/type_certainty/mod.rs b/clippy_utils/src/ty/type_certainty/mod.rs
index dc7756533ac..4b06b12fb94 100644
--- a/clippy_utils/src/ty/type_certainty/mod.rs
+++ b/clippy_utils/src/ty/type_certainty/mod.rs
@@ -207,7 +207,8 @@ fn path_segment_certainty(
             // Checking `res_generics_def_id(..)` before calling `generics_of` avoids an ICE.
             if cx.tcx.res_generics_def_id(path_segment.res).is_some() {
                 let generics = cx.tcx.generics_of(def_id);
-                let lhs = if (parent_certainty.is_certain() || generics.parent_count == 0) && generics.params.is_empty()
+                let count = generics.params.len() - generics.host_effect_index.is_some() as usize;
+                let lhs = if (parent_certainty.is_certain() || generics.parent_count == 0) && count == 0
                 {
                     Certainty::Certain(None)
                 } else {
@@ -299,7 +300,7 @@ fn type_is_inferrable_from_arguments(cx: &LateContext<'_>, expr: &Expr<'_>) -> b
 
     // Check that all type parameters appear in the functions input types.
     (0..(generics.parent_count + generics.params.len()) as u32).all(|index| {
-        fn_sig
+        Some(index as usize) == generics.host_effect_index || fn_sig
             .inputs()
             .iter()
             .any(|input_ty| contains_param(*input_ty.skip_binder(), index))