- Notifications
You must be signed in to change notification settings - Fork 13.9k
Fix types being marked as dead when they are inferred generic arguments #148262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix types being marked as dead when they are inferred generic arguments #148262
Conversation
| r? @nnethercote rustbot has assigned @nnethercote. Use |
6d0e333 to 5af2270 Compare | r=me with the nit addressed, thanks! @bors delegate=JonathanBrouwer |
| ✌️ @JonathanBrouwer, you can now approve this pull request! If @nnethercote told you to " |
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
5af2270 to a09c4fc Compare | @bors r=nnethercote rollup |
…e, r=nnethercote Fix types being marked as dead when they are inferred generic arguments Previously usages of a type in a pattern were ignored. This is incorrect, since if the type is in a pattern we're clearly producing it in the expression we're matching against. I think this `in_pat` check was meant to be only for variants, which we should indeed ignore since we can just remove the match arm that matches the pattern. Please double check my logic here since this is my first time touching the dead-code pass and I'm not 100% sure this is what the `self.in_pat` check was for. Fixes rust-lang#148144
Rollup of 4 pull requests Successful merges: - #139751 (Implement pin-project in pattern matching for `&pin mut|const T`) - #147633 (Add new `--bypass-ignore-backends` option) - #148262 (Fix types being marked as dead when they are inferred generic arguments) - #148268 (rustdoc: fix `--emit=dep-info` on scraped examples) r? `@ghost` `@rustbot` modify labels: rollup
…e, r=nnethercote Fix types being marked as dead when they are inferred generic arguments Previously usages of a type in a pattern were ignored. This is incorrect, since if the type is in a pattern we're clearly producing it in the expression we're matching against. I think this `in_pat` check was meant to be only for variants, which we should indeed ignore since we can just remove the match arm that matches the pattern. Please double check my logic here since this is my first time touching the dead-code pass and I'm not 100% sure this is what the `self.in_pat` check was for. Fixes rust-lang#148144
Previously usages of a type in a pattern were ignored. This is incorrect, since if the type is in a pattern we're clearly producing it in the expression we're matching against.
I think this
in_patcheck was meant to be only for variants, which we should indeed ignore since we can just remove the match arm that matches the pattern. Please double check my logic here since this is my first time touching the dead-code pass and I'm not 100% sure this is what theself.in_patcheck was for.Fixes #148144