Skip to content

Rollup of 5 pull requests #72539

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

Merged
merged 18 commits into from
May 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5728c53
Use `HirId` as key for `ResolverOutputs::trait_map` instead of `NodeId`
marmeladema May 20, 2020
3c5dba7
Use `HirId` in value of `ResolverOutputs::trait_map` instead of `NodeId`
marmeladema May 20, 2020
52359f7
Use `HirId` in `ResolverOutputs::export_map` instead of `NodeId`
marmeladema May 20, 2020
13c86f2
Use `LocalDefId` in `ResolverOutputs::maybe_unused_trait_imports` ins…
marmeladema May 20, 2020
25f575b
Use `DefId` in `ResolverOutputs::maybe_unused_extern_crates` instead …
marmeladema May 20, 2020
21f65ae
Use `DefId` in `ResolverOutputs::glob_map` instead of `NodeId`
marmeladema May 20, 2020
8ff6ffd
Use `DefId` in `ResolverOutputs::extern_crate_map` instead of `NodeId`
marmeladema May 20, 2020
4c4cb46
Use `collect()` instead of manually inserting elements into maps
marmeladema May 21, 2020
f31e076
Replace unecessary calls to `.clone()` by argument binding pattern fo…
marmeladema May 21, 2020
7a121ad
bootstrap: propagate test-args to miri and clippy test suites
RalfJung May 24, 2020
2220eb4
Clean up E0602 explanation
GuillaumeGomez May 24, 2020
d1f4796
Use `dyn` trait syntax in more comments and docs
ratijas May 24, 2020
df2f9a4
Use sort_unstable_by in its own docs
saschanaz May 24, 2020
95c4583
Rollup merge of #72402 - marmeladema:resolver-outputs-def-id, r=ecsta…
RalfJung May 24, 2020
a75068a
Rollup merge of #72527 - RalfJung:miri-clippy-test-args, r=Mark-Simul…
RalfJung May 24, 2020
cdeef96
Rollup merge of #72530 - GuillaumeGomez:cleanup-e0602, r=Dylan-DPC
RalfJung May 24, 2020
67b4e2b
Rollup merge of #72532 - ratijas:dyn-trait-object-doc, r=jonas-schievink
RalfJung May 24, 2020
134a165
Rollup merge of #72535 - saschanaz:patch-1, r=jonas-schievink
RalfJung May 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use collect() instead of manually inserting elements into maps
  • Loading branch information
marmeladema committed May 21, 2020
commit 4c4cb464912b82f08e4144b88dd4a0dc1a671a7e
88 changes: 42 additions & 46 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,37 +1274,35 @@ impl<'a> Resolver<'a> {

pub fn into_outputs(self) -> ResolverOutputs {
let definitions = self.definitions;
let extern_crate_map = {
let mut map = FxHashMap::default();
for (k, v) in self.extern_crate_map.into_iter() {
map.insert(definitions.local_def_id(k).to_def_id(), v);
}
map
};
let export_map = {
let mut map = FxHashMap::default();
for (k, v) in self.export_map.into_iter() {
map.insert(
let extern_crate_map = self
.extern_crate_map
.into_iter()
.map(|(k, v)| (definitions.local_def_id(k).to_def_id(), v))
.collect();
let export_map = self
.export_map
.into_iter()
.map(|(k, v)| {
(
k,
v.into_iter()
.map(|e| e.map_id(|id| definitions.node_id_to_hir_id(id)))
.collect(),
);
}
map
};
let trait_map = {
let mut map = FxHashMap::default();
for (k, v) in self.trait_map.into_iter() {
map.insert(
)
})
.collect();
let trait_map = self
.trait_map
.into_iter()
.map(|(k, v)| {
(
definitions.node_id_to_hir_id(k),
v.into_iter()
.map(|tc| tc.map_import_ids(|id| definitions.node_id_to_hir_id(id)))
.collect(),
);
}
map
};
)
})
.collect();
let maybe_unused_trait_imports = self
.maybe_unused_trait_imports
.into_iter()
Expand Down Expand Up @@ -1341,40 +1339,38 @@ impl<'a> Resolver<'a> {
ResolverOutputs {
definitions: self.definitions.clone(),
cstore: Box::new(self.cstore().clone()),
extern_crate_map: {
let mut map = FxHashMap::default();
for (k, v) in self.extern_crate_map.iter() {
map.insert(self.definitions.local_def_id(k.clone()).to_def_id(), v.clone());
}
map
},
export_map: {
let mut map = FxHashMap::default();
for (k, v) in self.export_map.iter() {
map.insert(
extern_crate_map: self
.extern_crate_map
.iter()
.map(|(k, v)| (self.definitions.local_def_id(k.clone()).to_def_id(), v.clone()))
.collect(),
export_map: self
.export_map
.iter()
.map(|(k, v)| {
(
k.clone(),
v.iter()
.map(|e| e.clone().map_id(|id| self.definitions.node_id_to_hir_id(id)))
.collect(),
);
}
map
},
trait_map: {
let mut map = FxHashMap::default();
for (k, v) in self.trait_map.iter() {
map.insert(
)
})
.collect(),
trait_map: self
.trait_map
.iter()
.map(|(k, v)| {
(
self.definitions.node_id_to_hir_id(k.clone()),
v.iter()
.map(|tc| {
tc.clone()
.map_import_ids(|id| self.definitions.node_id_to_hir_id(id))
})
.collect(),
);
}
map
},
)
})
.collect(),
glob_map: self
.glob_map
.iter()
Expand Down