diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2022-12-01 18:57:53 +0100 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-01-09 19:10:00 +0100 |
| commit | 2855794257e36ec7393f3b7d8f4b99e5776f550f (patch) | |
| tree | 0d90d03a27e2d6b86dbdfd0233f71aeb804027e4 /compiler/rustc_const_eval/src | |
| parent | 89e0576bd3aec2f1acf935b353900bd75742860b (diff) | |
| download | rust-2855794257e36ec7393f3b7d8f4b99e5776f550f.tar.gz rust-2855794257e36ec7393f3b7d8f4b99e5776f550f.zip | |
Use newtype for unused generic parameters
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/util.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs index e4f716c3194..a61d3ab40a5 100644 --- a/compiler/rustc_const_eval/src/interpret/util.rs +++ b/compiler/rustc_const_eval/src/interpret/util.rs @@ -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); } } |
