Skip to content

Commit 99f6221

Browse files
committed
Update borrowck
1 parent 8c936e4 commit 99f6221

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/librustc/arena.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ macro_rules! arena_types {
5959
rustc::infer::canonical::QueryResponse<'tcx, rustc::ty::Ty<'tcx>>
6060
>,
6161
[few] crate_inherent_impls: rustc::ty::CrateInherentImpls,
62+
[decode] borrowck: rustc::middle::borrowck::BorrowCheckResult,
6263
], $tcx);
6364
)
6465
}

src/librustc/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ rustc_queries! {
371371
}
372372

373373
BorrowChecking {
374-
query borrowck(_: DefId) -> Lrc<BorrowCheckResult> {}
374+
query borrowck(_: DefId) -> &'tcx BorrowCheckResult {}
375375

376376
/// Borrow-checks the function body. If this is a closure, returns
377377
/// additional requirements that the closure's creator must verify.

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use std::borrow::Cow;
3232
use std::cell::{Cell, RefCell};
3333
use std::fmt;
3434
use std::rc::Rc;
35-
use rustc_data_structures::sync::Lrc;
3635
use std::hash::{Hash, Hasher};
3736
use syntax::source_map::CompilerDesugaringKind;
3837
use syntax_pos::{MultiSpan, Span};
@@ -75,7 +74,7 @@ pub struct AnalysisData<'a, 'tcx: 'a> {
7574
}
7675

7776
fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
78-
-> Lrc<BorrowCheckResult>
77+
-> &'tcx BorrowCheckResult
7978
{
8079
assert!(tcx.use_ast_borrowck() || tcx.migrate_borrowck());
8180

@@ -89,7 +88,7 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
8988
// those things (notably the synthesized constructors from
9089
// tuple structs/variants) do not have an associated body
9190
// and do not need borrowchecking.
92-
return Lrc::new(BorrowCheckResult {
91+
return tcx.arena.alloc(BorrowCheckResult {
9392
used_mut_nodes: Default::default(),
9493
signalled_any_error: SignalledError::NoErrorsSeen,
9594
})
@@ -136,7 +135,7 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
136135
check_loans::check_loans(&mut bccx, &loan_dfcx, &flowed_moves, &all_loans, body);
137136
}
138137

139-
Lrc::new(BorrowCheckResult {
138+
tcx.arena.alloc(BorrowCheckResult {
140139
used_mut_nodes: bccx.used_mut_nodes.into_inner(),
141140
signalled_any_error: bccx.signalled_any_error.into_inner(),
142141
})

0 commit comments

Comments
 (0)