@@ -32,7 +32,6 @@ use std::borrow::Cow;
32
32
use std:: cell:: { Cell , RefCell } ;
33
33
use std:: fmt;
34
34
use std:: rc:: Rc ;
35
- use rustc_data_structures:: sync:: Lrc ;
36
35
use std:: hash:: { Hash , Hasher } ;
37
36
use syntax:: source_map:: CompilerDesugaringKind ;
38
37
use syntax_pos:: { MultiSpan , Span } ;
@@ -75,7 +74,7 @@ pub struct AnalysisData<'a, 'tcx: 'a> {
75
74
}
76
75
77
76
fn borrowck < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , owner_def_id : DefId )
78
- -> Lrc < BorrowCheckResult >
77
+ -> & ' tcx BorrowCheckResult
79
78
{
80
79
assert ! ( tcx. use_ast_borrowck( ) || tcx. migrate_borrowck( ) ) ;
81
80
@@ -89,7 +88,7 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
89
88
// those things (notably the synthesized constructors from
90
89
// tuple structs/variants) do not have an associated body
91
90
// and do not need borrowchecking.
92
- return Lrc :: new ( BorrowCheckResult {
91
+ return tcx . arena . alloc ( BorrowCheckResult {
93
92
used_mut_nodes : Default :: default ( ) ,
94
93
signalled_any_error : SignalledError :: NoErrorsSeen ,
95
94
} )
@@ -136,7 +135,7 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
136
135
check_loans:: check_loans ( & mut bccx, & loan_dfcx, & flowed_moves, & all_loans, body) ;
137
136
}
138
137
139
- Lrc :: new ( BorrowCheckResult {
138
+ tcx . arena . alloc ( BorrowCheckResult {
140
139
used_mut_nodes : bccx. used_mut_nodes . into_inner ( ) ,
141
140
signalled_any_error : bccx. signalled_any_error . into_inner ( ) ,
142
141
} )
0 commit comments