diff options
| author | bors <bors@rust-lang.org> | 2022-02-10 09:37:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-02-10 09:37:07 +0000 |
| commit | 56cd04af5c389b6ab676ba16f59d9f70bc465090 (patch) | |
| tree | af86c44fca9e62cce5d7e5b6701b2227489fe06d /compiler/rustc_interface | |
| parent | 5d6ee0db96aada145725838379f909bbb8aa2312 (diff) | |
| parent | 8edd32c9404f416945d82c438a62acb7f90c2f62 (diff) | |
| download | rust-56cd04af5c389b6ab676ba16f59d9f70bc465090.tar.gz rust-56cd04af5c389b6ab676ba16f59d9f70bc465090.zip | |
Auto merge of #93511 - cjgillot:query-copy, r=oli-obk
Ensure that queries only return Copy types. This should pervent the perf footgun of returning a result with an expensive `Clone` impl (like a `Vec` of a hash map). I went for the stupid solution of allocating on an arena everything that was not `Copy`. Some query results could be made Copy easily, but I did not really investigate.
Diffstat (limited to 'compiler/rustc_interface')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 7a3d77466c5..f5a4e11de16 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -658,13 +658,13 @@ fn write_out_deps( boxed_resolver.borrow_mut().access(|resolver| { for cnum in resolver.cstore().crates_untracked() { let source = resolver.cstore().crate_source_untracked(cnum); - if let Some((path, _)) = source.dylib { + if let Some((path, _)) = &source.dylib { files.push(escape_dep_filename(&path.display().to_string())); } - if let Some((path, _)) = source.rlib { + if let Some((path, _)) = &source.rlib { files.push(escape_dep_filename(&path.display().to_string())); } - if let Some((path, _)) = source.rmeta { + if let Some((path, _)) = &source.rmeta { files.push(escape_dep_filename(&path.display().to_string())); } } |
