@@ -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 } ;
@@ -77,7 +76,7 @@ pub struct AnalysisData<'a, 'tcx: 'a> {
7776}
7877
7978fn borrowck < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , owner_def_id : DefId )
80- -> Lrc < BorrowCheckResult >
79+ -> & ' tcx BorrowCheckResult
8180{
8281 assert ! ( tcx. use_ast_borrowck( ) || tcx. migrate_borrowck( ) ) ;
8382
@@ -91,7 +90,7 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
9190 // those things (notably the synthesized constructors from
9291 // tuple structs/variants) do not have an associated body
9392 // and do not need borrowchecking.
94- return Lrc :: new ( BorrowCheckResult {
93+ return tcx . arena . alloc ( BorrowCheckResult {
9594 used_mut_nodes : Default :: default ( ) ,
9695 signalled_any_error : SignalledError :: NoErrorsSeen ,
9796 } )
@@ -142,7 +141,7 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
142141 unused:: check ( & mut bccx, body) ;
143142 }
144143
145- Lrc :: new ( BorrowCheckResult {
144+ tcx . arena . alloc ( BorrowCheckResult {
146145 used_mut_nodes : bccx. used_mut_nodes . into_inner ( ) ,
147146 signalled_any_error : bccx. signalled_any_error . into_inner ( ) ,
148147 } )
0 commit comments