@@ -32,7 +32,6 @@ use std::borrow::Cow;
3232use std:: cell:: { Cell , RefCell } ;
3333use std:: fmt;
3434use std:: rc:: Rc ;
35- use rustc_data_structures:: sync:: Lrc ;
3635use std:: hash:: { Hash , Hasher } ;
3736use syntax:: source_map:: CompilerDesugaringKind ;
3837use syntax_pos:: { MultiSpan , Span } ;
@@ -75,7 +74,7 @@ pub struct AnalysisData<'a, 'tcx: 'a> {
7574}
7675
7776fn 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