Use newtype for unused generic parameters
This commit is contained in:
parent
89e0576bd3
commit
2855794257
10 changed files with 65 additions and 33 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