diff options
| author | bors <bors@rust-lang.org> | 2024-02-26 17:25:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-26 17:25:43 +0000 |
| commit | d71899573a2826392ef08dc3bea796f5e077ecdf (patch) | |
| tree | af3b3ff4af2aadd1a95c59490695ceb11e0d2da8 /compiler/rustc_pattern_analysis/src | |
| parent | a11875bd226a5ecedd87b766bfe4f7bd2df32299 (diff) | |
| parent | 97dc4b22c61ab52de80b495ca0e583c4c5c73a9f (diff) | |
| download | rust-d71899573a2826392ef08dc3bea796f5e077ecdf.tar.gz rust-d71899573a2826392ef08dc3bea796f5e077ecdf.zip | |
Auto merge of #12355 - Ethiraric:fix-11927, r=Alexendoo
[`box_default`]: Preserve required path segments When encountering code such as: ```rs Box::new(outer::Inner::default()) ``` clippy would suggest replacing with `Box::<Inner>::default()`, dropping the `outer::` segment. This behavior is incorrect and that commit fixes it. What it does is it checks the contents of the `Box::new` and, if it is of the form `A::B::default`, does a text replacement, inserting `A::B` in the `Box`'s quickfix generic list. If the source does not match that pattern (including `Vec::from(..)` or other `T::new()` calls), we then fallback to the original code. Fixes #11927 *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`box_default`]: Preserve required path segments
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions
