Skip to content

Commit

Permalink
Auto merge of rust-lang#131988 - matthiaskrgr:rollup-tx173wn, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#126588 (Added more scenarios where comma to be removed in the function arg)
 - rust-lang#131728 (bootstrap: extract builder cargo to its own module)
 - rust-lang#131968 (Rip out old effects var handling code from traits)
 - rust-lang#131981 (Remove the `BoundConstness::NotConst` variant)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Oct 21, 2024
2 parents 69b0886 + d8b2f93 commit 1d0dad5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
9 changes: 0 additions & 9 deletions clippy_lints/src/implied_bounds_in_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
15 changes: 1 addition & 14 deletions clippy_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit 1d0dad5

Please sign in to comment.