Skip to content

Commit b8b4ad5

Browse files
committed
Update region_scope_tree
1 parent 5d67618 commit b8b4ad5

File tree

8 files changed

+10
-14
lines changed

8 files changed

+10
-14
lines changed

src/librustc/arena.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ macro_rules! arena_types {
1616
)>,
1717
[few] mir_keys: rustc::util::nodemap::DefIdSet,
1818
[decode] specialization_graph: rustc::traits::specialization_graph::Graph,
19+
[] region_scope_tree: rustc::middle::region::ScopeTree,
1920
], $tcx);
2021
)
2122
}

src/librustc/middle/region.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::ty;
1212

1313
use std::mem;
1414
use std::fmt;
15-
use rustc_data_structures::sync::Lrc;
1615
use rustc_macros::HashStable;
1716
use syntax::source_map;
1817
use syntax::ast;
@@ -1323,7 +1322,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionResolutionVisitor<'a, 'tcx> {
13231322
}
13241323

13251324
fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
1326-
-> Lrc<ScopeTree>
1325+
-> &'tcx ScopeTree
13271326
{
13281327
let closure_base_def_id = tcx.closure_base_def_id(def_id);
13291328
if closure_base_def_id != def_id {
@@ -1365,7 +1364,7 @@ fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
13651364
ScopeTree::default()
13661365
};
13671366

1368-
Lrc::new(scope_tree)
1367+
tcx.arena.alloc(scope_tree)
13691368
}
13701369

13711370
pub fn provide(providers: &mut Providers<'_>) {

src/librustc/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ rustc_queries! {
456456

457457
/// Per-body `region::ScopeTree`. The `DefId` should be the owner `DefId` for the body;
458458
/// in the case of closures, this will be redirected to the enclosing function.
459-
query region_scope_tree(_: DefId) -> Lrc<region::ScopeTree> {}
459+
query region_scope_tree(_: DefId) -> &'tcx region::ScopeTree {}
460460

461461
query mir_shims(key: ty::InstanceDef<'tcx>) -> &'tcx mir::Mir<'tcx> {
462462
no_force

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub struct BorrowckCtxt<'a, 'tcx: 'a> {
228228
// Some in `borrowck_fn` and cleared later
229229
tables: &'a ty::TypeckTables<'tcx>,
230230

231-
region_scope_tree: Lrc<region::ScopeTree>,
231+
region_scope_tree: &'tcx region::ScopeTree,
232232

233233
owner_def_id: DefId,
234234

src/librustc_mir/borrow_check/error_reporting.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use rustc::ty::layout::VariantIdx;
1717
use rustc::ty::print::Print;
1818
use rustc_data_structures::fx::FxHashSet;
1919
use rustc_data_structures::indexed_vec::Idx;
20-
use rustc_data_structures::sync::Lrc;
2120
use rustc_errors::{Applicability, DiagnosticBuilder};
2221
use syntax_pos::Span;
2322
use syntax::source_map::CompilerDesugaringKind;
@@ -811,7 +810,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
811810
&mut self,
812811
context: Context,
813812
name: &str,
814-
scope_tree: &Lrc<ScopeTree>,
813+
scope_tree: &'tcx ScopeTree,
815814
borrow: &BorrowData<'tcx>,
816815
drop_span: Span,
817816
borrow_spans: UseSpans,
@@ -1000,7 +999,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1000999
fn report_temporary_value_does_not_live_long_enough(
10011000
&mut self,
10021001
context: Context,
1003-
scope_tree: &Lrc<ScopeTree>,
1002+
scope_tree: &'tcx ScopeTree,
10041003
borrow: &BorrowData<'tcx>,
10051004
drop_span: Span,
10061005
borrow_spans: UseSpans,

src/librustc_mir/hair/cx/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use syntax::ast;
1818
use syntax::attr;
1919
use syntax::symbol::Symbol;
2020
use rustc::hir;
21-
use rustc_data_structures::sync::Lrc;
2221
use crate::hair::constant::{lit_to_const, LitToConstError};
2322

2423
#[derive(Clone)]
@@ -32,7 +31,7 @@ pub struct Cx<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
3231
/// Identity `InternalSubsts` for use with const-evaluation.
3332
pub identity_substs: &'gcx InternalSubsts<'gcx>,
3433

35-
pub region_scope_tree: Lrc<region::ScopeTree>,
34+
pub region_scope_tree: &'gcx region::ScopeTree,
3635
pub tables: &'a ty::TypeckTables<'gcx>,
3736

3837
/// This is `Constness::Const` if we are compiling a `static`,

src/librustc_typeck/check/generator_interior.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
88
use rustc::hir::{self, Pat, PatKind, Expr};
99
use rustc::middle::region;
1010
use rustc::ty::{self, Ty};
11-
use rustc_data_structures::sync::Lrc;
1211
use syntax_pos::Span;
1312
use super::FnCtxt;
1413
use crate::util::nodemap::FxHashMap;
1514

1615
struct InteriorVisitor<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
1716
fcx: &'a FnCtxt<'a, 'gcx, 'tcx>,
1817
types: FxHashMap<Ty<'tcx>, usize>,
19-
region_scope_tree: Lrc<region::ScopeTree>,
18+
region_scope_tree: &'gcx region::ScopeTree,
2019
expr_count: usize,
2120
}
2221

src/librustc_typeck/check/regionck.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ use rustc::ty::{self, Ty};
8686

8787
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
8888
use rustc::hir::{self, PatKind};
89-
use rustc_data_structures::sync::Lrc;
9089
use std::mem;
9190
use std::ops::Deref;
9291
use std::rc::Rc;
@@ -195,7 +194,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
195194
pub struct RegionCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
196195
pub fcx: &'a FnCtxt<'a, 'gcx, 'tcx>,
197196

198-
pub region_scope_tree: Lrc<region::ScopeTree>,
197+
pub region_scope_tree: &'gcx region::ScopeTree,
199198

200199
outlives_environment: OutlivesEnvironment<'tcx>,
201200

0 commit comments

Comments
 (0)