diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-20 13:39:52 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-20 13:40:22 +0000 |
| commit | d8b2f9364d527a50462114df955072219fda2079 (patch) | |
| tree | 1b3b43688763f94d5a3837918358244278495782 | |
| parent | 91a458f45106082f31dea172156b9ad6400a9955 (diff) | |
| download | rust-d8b2f9364d527a50462114df955072219fda2079.tar.gz rust-d8b2f9364d527a50462114df955072219fda2079.zip | |
Rip out old effects var handling code from traits
| -rw-r--r-- | clippy_lints/src/implied_bounds_in_impls.rs | 9 | ||||
| -rw-r--r-- | clippy_utils/src/ty.rs | 15 |
2 files changed, 1 insertions, 23 deletions
diff --git a/clippy_lints/src/implied_bounds_in_impls.rs b/clippy_lints/src/implied_bounds_in_impls.rs index f4c00d8287d..00f83237224 100644 --- a/clippy_lints/src/implied_bounds_in_impls.rs +++ b/clippy_lints/src/implied_bounds_in_impls.rs @@ -190,15 +190,6 @@ fn is_same_generics<'tcx>( .enumerate() .skip(1) // skip `Self` implicit arg .all(|(arg_index, arg)| { - if [ - implied_by_generics.host_effect_index, - implied_generics.host_effect_index, - ] - .contains(&Some(arg_index)) - { - // skip host effect params in determining whether generics are same - return true; - } if let Some(ty) = arg.as_type() { if let &ty::Param(ty::ParamTy { index, .. }) = ty.kind() // `index == 0` means that it's referring to `Self`, diff --git a/clippy_utils/src/ty.rs b/clippy_utils/src/ty.rs index b7a3569ccf0..cab16b4927d 100644 --- a/clippy_utils/src/ty.rs +++ b/clippy_utils/src/ty.rs @@ -274,23 +274,10 @@ pub fn implements_trait_with_env_from_iter<'tcx>( .map(|arg| arg.into().unwrap_or_else(|| infcx.next_ty_var(DUMMY_SP).into())) .collect::<Vec<_>>(); - // If an effect arg was not specified, we need to specify it. - let effect_arg = if tcx - .generics_of(trait_id) - .host_effect_index - .is_some_and(|x| args.get(x - 1).is_none()) - { - Some(GenericArg::from(callee_id.map_or(tcx.consts.true_, |def_id| { - tcx.expected_host_effect_param_for_body(def_id) - }))) - } else { - None - }; - let trait_ref = TraitRef::new( tcx, trait_id, - [GenericArg::from(ty)].into_iter().chain(args).chain(effect_arg), + [GenericArg::from(ty)].into_iter().chain(args), ); debug_assert_matches!( |
