Skip to content

Commit 88a2342

Browse files
committed
Update upvars and module_exports
1 parent c038ccb commit 88a2342

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/librustc/query/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ rustc_queries! {
646646
}
647647

648648
Other {
649-
query module_exports(_: DefId) -> Option<Lrc<Vec<Export<hir::HirId>>>> {
649+
query module_exports(_: DefId) -> Option<&'tcx [Export<hir::HirId>]> {
650650
eval_always
651651
}
652652
}
@@ -824,7 +824,7 @@ rustc_queries! {
824824
desc { "generating a postorder list of CrateNums" }
825825
}
826826

827-
query upvars(_: DefId) -> Option<Lrc<Vec<hir::Upvar>>> {
827+
query upvars(_: DefId) -> Option<&'tcx [hir::Upvar]> {
828828
eval_always
829829
}
830830
query maybe_unused_trait_import(_: DefId) -> bool {

src/librustc/ty/context.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ pub struct GlobalCtxt<'tcx> {
10681068
StableVec<TraitCandidate>>>,
10691069

10701070
/// Export map produced by name resolution.
1071-
export_map: FxHashMap<DefId, Lrc<Vec<Export<hir::HirId>>>>,
1071+
export_map: FxHashMap<DefId, Vec<Export<hir::HirId>>>,
10721072

10731073
hir_map: hir_map::Map<'tcx>,
10741074

@@ -1081,7 +1081,7 @@ pub struct GlobalCtxt<'tcx> {
10811081
// Records the captured variables referenced by every closure
10821082
// expression. Do not track deps for this, just recompute it from
10831083
// scratch every time.
1084-
upvars: FxHashMap<DefId, Lrc<Vec<hir::Upvar>>>,
1084+
upvars: FxHashMap<DefId, Vec<hir::Upvar>>,
10851085

10861086
maybe_unused_trait_imports: FxHashSet<DefId>,
10871087
maybe_unused_extern_crates: Vec<(DefId, Span)>,
@@ -1328,13 +1328,13 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
13281328
let exports: Vec<_> = v.into_iter().map(|e| {
13291329
e.map_id(|id| hir.node_to_hir_id(id))
13301330
}).collect();
1331-
(k, Lrc::new(exports))
1331+
(k, exports)
13321332
}).collect(),
13331333
upvars: resolutions.upvars.into_iter().map(|(k, v)| {
13341334
let vars: Vec<_> = v.into_iter().map(|e| {
13351335
e.map_id(|id| hir.node_to_hir_id(id))
13361336
}).collect();
1337-
(hir.local_def_id(k), Lrc::new(vars))
1337+
(hir.local_def_id(k), vars)
13381338
}).collect(),
13391339
maybe_unused_trait_imports:
13401340
resolutions.maybe_unused_trait_imports
@@ -3053,7 +3053,7 @@ fn ptr_eq<T, U>(t: *const T, u: *const U) -> bool {
30533053

30543054
pub fn provide(providers: &mut ty::query::Providers<'_>) {
30553055
providers.in_scope_traits_map = |tcx, id| tcx.gcx.trait_map.get(&id);
3056-
providers.module_exports = |tcx, id| tcx.gcx.export_map.get(&id).cloned();
3056+
providers.module_exports = |tcx, id| tcx.gcx.export_map.get(&id).map(|v| &v[..]);
30573057
providers.crate_name = |tcx, id| {
30583058
assert_eq!(id, LOCAL_CRATE);
30593059
tcx.crate_name
@@ -3066,7 +3066,7 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) {
30663066
assert_eq!(id, LOCAL_CRATE);
30673067
Lrc::new(middle::lang_items::collect(tcx))
30683068
};
3069-
providers.upvars = |tcx, id| tcx.gcx.upvars.get(&id).cloned();
3069+
providers.upvars = |tcx, id| tcx.gcx.upvars.get(&id).map(|v| &v[..]);
30703070
providers.maybe_unused_trait_import = |tcx, id| {
30713071
tcx.maybe_unused_trait_imports.contains(&id)
30723072
};

src/librustc_metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
692692

693693
let data = ModData {
694694
reexports: match tcx.module_exports(def_id) {
695-
Some(ref exports) => self.lazy_seq_from_slice(exports.as_slice()),
695+
Some(ref exports) => self.lazy_seq_from_slice(exports),
696696
_ => LazySeq::empty(),
697697
},
698698
};

0 commit comments

Comments
 (0)