Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
Polymorphization cleanup Split out of #106233 Use a newtype instead of a bitset directly. This makes the code way easier to read and easier to adapt for future changes.
This commit is contained in:
commit
6e0c404f76
10 changed files with 66 additions and 79 deletions
|
@ -40,12 +40,11 @@ where
|
|||
let index = index
|
||||
.try_into()
|
||||
.expect("more generic parameters than can fit into a `u32`");
|
||||
let is_used = unused_params.contains(index).map_or(true, |unused| !unused);
|
||||
// Only recurse when generic parameters in fns, closures and generators
|
||||
// are used and require substitution.
|
||||
// Just in case there are closures or generators within this subst,
|
||||
// recurse.
|
||||
if is_used && subst.needs_subst() {
|
||||
if unused_params.is_used(index) && subst.needs_subst() {
|
||||
return subst.visit_with(self);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue