Skip to content

Commit 282f7a3

Browse files
committed
rename Tables to TypeckTables
1 parent 80b5f98 commit 282f7a3

File tree

52 files changed

+183
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+183
-183
lines changed

src/librustc/cfg/construct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use hir::{self, PatKind};
1818

1919
struct CFGBuilder<'a, 'tcx: 'a> {
2020
tcx: TyCtxt<'a, 'tcx, 'tcx>,
21-
tables: &'a ty::Tables<'tcx>,
21+
tables: &'a ty::TypeckTables<'tcx>,
2222
graph: CFGGraph,
2323
fn_exit: CFGIndex,
2424
loop_scopes: Vec<LoopScope>,

src/librustc/dep_graph/README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,15 @@ The idea is that you can annotate a test like:
326326
#[rustc_if_this_changed]
327327
fn foo() { }
328328

329-
#[rustc_then_this_would_need(Tables)] //~ ERROR OK
329+
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
330330
fn bar() { foo(); }
331331

332-
#[rustc_then_this_would_need(Tables)] //~ ERROR no path
332+
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
333333
fn baz() { }
334334
```
335335

336336
This will check whether there is a path in the dependency graph from
337-
`Hir(foo)` to `Tables(bar)`. An error is reported for each
337+
`Hir(foo)` to `TypeckTables(bar)`. An error is reported for each
338338
`#[rustc_then_this_would_need]` annotation that indicates whether a
339339
path exists. `//~ ERROR` annotations can then be used to test if a
340340
path is found (as demonstrated above).
@@ -371,27 +371,27 @@ A node is considered to match a filter if all of those strings appear in its
371371
label. So, for example:
372372

373373
```
374-
RUST_DEP_GRAPH_FILTER='-> Tables'
374+
RUST_DEP_GRAPH_FILTER='-> TypeckTables'
375375
```
376376

377-
would select the predecessors of all `Tables` nodes. Usually though you
378-
want the `Tables` node for some particular fn, so you might write:
377+
would select the predecessors of all `TypeckTables` nodes. Usually though you
378+
want the `TypeckTables` node for some particular fn, so you might write:
379379

380380
```
381-
RUST_DEP_GRAPH_FILTER='-> Tables & bar'
381+
RUST_DEP_GRAPH_FILTER='-> TypeckTables & bar'
382382
```
383383

384-
This will select only the `Tables` nodes for fns with `bar` in their name.
384+
This will select only the `TypeckTables` nodes for fns with `bar` in their name.
385385

386386
Perhaps you are finding that when you change `foo` you need to re-type-check `bar`,
387387
but you don't think you should have to. In that case, you might do:
388388

389389
```
390-
RUST_DEP_GRAPH_FILTER='Hir&foo -> Tables & bar'
390+
RUST_DEP_GRAPH_FILTER='Hir&foo -> TypeckTables & bar'
391391
```
392392

393393
This will dump out all the nodes that lead from `Hir(foo)` to
394-
`Tables(bar)`, from which you can (hopefully) see the source
394+
`TypeckTables(bar)`, from which you can (hopefully) see the source
395395
of the erroneous edge.
396396

397397
#### Tracking down incorrect edges
@@ -417,7 +417,7 @@ dep-graph as described in the previous section and open `dep-graph.txt`
417417
to see something like:
418418

419419
Hir(foo) -> Collect(bar)
420-
Collect(bar) -> Tables(bar)
420+
Collect(bar) -> TypeckTables(bar)
421421

422422
That first edge looks suspicious to you. So you set
423423
`RUST_FORBID_DEP_GRAPH_EDGE` to `Hir&foo -> Collect&bar`, re-run, and

src/librustc/dep_graph/dep_node.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub enum DepNode<D: Clone + Debug> {
112112
SizedConstraint(D),
113113
AssociatedItemDefIds(D),
114114
InherentImpls(D),
115-
Tables(D),
115+
TypeckTables(D),
116116

117117
// The set of impls for a given trait. Ultimately, it would be
118118
// nice to get more fine-grained here (e.g., to include a
@@ -161,7 +161,7 @@ impl<D: Clone + Debug> DepNode<D> {
161161
ItemSignature,
162162
AssociatedItemDefIds,
163163
InherentImpls,
164-
Tables,
164+
TypeckTables,
165165
TraitImpls,
166166
ReprHints,
167167
}
@@ -229,7 +229,7 @@ impl<D: Clone + Debug> DepNode<D> {
229229
SizedConstraint(ref d) => op(d).map(SizedConstraint),
230230
AssociatedItemDefIds(ref d) => op(d).map(AssociatedItemDefIds),
231231
InherentImpls(ref d) => op(d).map(InherentImpls),
232-
Tables(ref d) => op(d).map(Tables),
232+
TypeckTables(ref d) => op(d).map(TypeckTables),
233233
TraitImpls(ref d) => op(d).map(TraitImpls),
234234
TraitItems(ref d) => op(d).map(TraitItems),
235235
ReprHints(ref d) => op(d).map(ReprHints),

src/librustc/infer/mod.rs

+24-24
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,23 @@ pub type Bound<T> = Option<T>;
7676
pub type UnitResult<'tcx> = RelateResult<'tcx, ()>; // "unify result"
7777
pub type FixupResult<T> = Result<T, FixupError>; // "fixup result"
7878

79-
/// A version of &ty::Tables which can be `Missing` (not needed),
79+
/// A version of &ty::TypeckTables which can be `Missing` (not needed),
8080
/// `InProgress` (during typeck) or `Interned` (result of typeck).
8181
/// Only the `InProgress` version supports `borrow_mut`.
8282
#[derive(Copy, Clone)]
8383
pub enum InferTables<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
84-
Interned(&'a ty::Tables<'gcx>),
85-
InProgress(&'a RefCell<ty::Tables<'tcx>>),
84+
Interned(&'a ty::TypeckTables<'gcx>),
85+
InProgress(&'a RefCell<ty::TypeckTables<'tcx>>),
8686
Missing
8787
}
8888

8989
pub enum InferTablesRef<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
90-
Interned(&'a ty::Tables<'gcx>),
91-
InProgress(Ref<'a, ty::Tables<'tcx>>)
90+
Interned(&'a ty::TypeckTables<'gcx>),
91+
InProgress(Ref<'a, ty::TypeckTables<'tcx>>)
9292
}
9393

9494
impl<'a, 'gcx, 'tcx> Deref for InferTablesRef<'a, 'gcx, 'tcx> {
95-
type Target = ty::Tables<'tcx>;
95+
type Target = ty::TypeckTables<'tcx>;
9696
fn deref(&self) -> &Self::Target {
9797
match *self {
9898
InferTablesRef::Interned(tables) => tables,
@@ -112,7 +112,7 @@ impl<'a, 'gcx, 'tcx> InferTables<'a, 'gcx, 'tcx> {
112112
}
113113
}
114114

115-
pub fn expect_interned(self) -> &'a ty::Tables<'gcx> {
115+
pub fn expect_interned(self) -> &'a ty::TypeckTables<'gcx> {
116116
match self {
117117
InferTables::Interned(tables) => tables,
118118
InferTables::InProgress(_) => {
@@ -124,7 +124,7 @@ impl<'a, 'gcx, 'tcx> InferTables<'a, 'gcx, 'tcx> {
124124
}
125125
}
126126

127-
pub fn borrow_mut(self) -> RefMut<'a, ty::Tables<'tcx>> {
127+
pub fn borrow_mut(self) -> RefMut<'a, ty::TypeckTables<'tcx>> {
128128
match self {
129129
InferTables::Interned(_) => {
130130
bug!("InferTables: infcx.tables.borrow_mut() outside of type-checking");
@@ -407,51 +407,51 @@ impl fmt::Display for FixupError {
407407

408408
pub trait InferEnv<'a, 'tcx> {
409409
fn to_parts(self, tcx: TyCtxt<'a, 'tcx, 'tcx>)
410-
-> (Option<&'a ty::Tables<'tcx>>,
411-
Option<ty::Tables<'tcx>>,
410+
-> (Option<&'a ty::TypeckTables<'tcx>>,
411+
Option<ty::TypeckTables<'tcx>>,
412412
Option<ty::ParameterEnvironment<'tcx>>);
413413
}
414414

415415
impl<'a, 'tcx> InferEnv<'a, 'tcx> for () {
416416
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
417-
-> (Option<&'a ty::Tables<'tcx>>,
418-
Option<ty::Tables<'tcx>>,
417+
-> (Option<&'a ty::TypeckTables<'tcx>>,
418+
Option<ty::TypeckTables<'tcx>>,
419419
Option<ty::ParameterEnvironment<'tcx>>) {
420420
(None, None, None)
421421
}
422422
}
423423

424424
impl<'a, 'tcx> InferEnv<'a, 'tcx> for ty::ParameterEnvironment<'tcx> {
425425
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
426-
-> (Option<&'a ty::Tables<'tcx>>,
427-
Option<ty::Tables<'tcx>>,
426+
-> (Option<&'a ty::TypeckTables<'tcx>>,
427+
Option<ty::TypeckTables<'tcx>>,
428428
Option<ty::ParameterEnvironment<'tcx>>) {
429429
(None, None, Some(self))
430430
}
431431
}
432432

433-
impl<'a, 'tcx> InferEnv<'a, 'tcx> for (&'a ty::Tables<'tcx>, ty::ParameterEnvironment<'tcx>) {
433+
impl<'a, 'tcx> InferEnv<'a, 'tcx> for (&'a ty::TypeckTables<'tcx>, ty::ParameterEnvironment<'tcx>) {
434434
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
435-
-> (Option<&'a ty::Tables<'tcx>>,
436-
Option<ty::Tables<'tcx>>,
435+
-> (Option<&'a ty::TypeckTables<'tcx>>,
436+
Option<ty::TypeckTables<'tcx>>,
437437
Option<ty::ParameterEnvironment<'tcx>>) {
438438
(Some(self.0), None, Some(self.1))
439439
}
440440
}
441441

442-
impl<'a, 'tcx> InferEnv<'a, 'tcx> for (ty::Tables<'tcx>, ty::ParameterEnvironment<'tcx>) {
442+
impl<'a, 'tcx> InferEnv<'a, 'tcx> for (ty::TypeckTables<'tcx>, ty::ParameterEnvironment<'tcx>) {
443443
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
444-
-> (Option<&'a ty::Tables<'tcx>>,
445-
Option<ty::Tables<'tcx>>,
444+
-> (Option<&'a ty::TypeckTables<'tcx>>,
445+
Option<ty::TypeckTables<'tcx>>,
446446
Option<ty::ParameterEnvironment<'tcx>>) {
447447
(None, Some(self.0), Some(self.1))
448448
}
449449
}
450450

451451
impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId {
452452
fn to_parts(self, tcx: TyCtxt<'a, 'tcx, 'tcx>)
453-
-> (Option<&'a ty::Tables<'tcx>>,
454-
Option<ty::Tables<'tcx>>,
453+
-> (Option<&'a ty::TypeckTables<'tcx>>,
454+
Option<ty::TypeckTables<'tcx>>,
455455
Option<ty::ParameterEnvironment<'tcx>>) {
456456
let item_id = tcx.map.body_owner(self);
457457
(Some(tcx.item_tables(tcx.map.local_def_id(item_id))),
@@ -466,8 +466,8 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId {
466466
pub struct InferCtxtBuilder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
467467
global_tcx: TyCtxt<'a, 'gcx, 'gcx>,
468468
arena: DroplessArena,
469-
fresh_tables: Option<RefCell<ty::Tables<'tcx>>>,
470-
tables: Option<&'a ty::Tables<'gcx>>,
469+
fresh_tables: Option<RefCell<ty::TypeckTables<'tcx>>>,
470+
tables: Option<&'a ty::TypeckTables<'gcx>>,
471471
param_env: Option<ty::ParameterEnvironment<'gcx>>,
472472
projection_mode: Reveal,
473473
}

src/librustc/lint/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ pub struct LateContext<'a, 'tcx: 'a> {
337337
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
338338

339339
/// Side-tables for the body we are in.
340-
pub tables: &'a ty::Tables<'tcx>,
340+
pub tables: &'a ty::TypeckTables<'tcx>,
341341

342342
/// The crate being checked.
343343
pub krate: &'a hir::Crate,
@@ -1212,7 +1212,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
12121212
let lint_store = mem::replace(&mut *tcx.sess.lint_store.borrow_mut(), LintStore::new());
12131213
let mut cx = LateContext {
12141214
tcx: tcx,
1215-
tables: &ty::Tables::empty(),
1215+
tables: &ty::TypeckTables::empty(),
12161216
krate: krate,
12171217
access_levels: access_levels,
12181218
lints: lint_store,

src/librustc/middle/dead.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn should_explore<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
4949
struct MarkSymbolVisitor<'a, 'tcx: 'a> {
5050
worklist: Vec<ast::NodeId>,
5151
tcx: TyCtxt<'a, 'tcx, 'tcx>,
52-
tables: &'a ty::Tables<'tcx>,
52+
tables: &'a ty::TypeckTables<'tcx>,
5353
live_symbols: Box<FxHashSet<ast::NodeId>>,
5454
struct_has_extern_repr: bool,
5555
ignore_non_const_paths: bool,
@@ -392,7 +392,7 @@ fn find_live<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
392392
let mut symbol_visitor = MarkSymbolVisitor {
393393
worklist: worklist,
394394
tcx: tcx,
395-
tables: &ty::Tables::empty(),
395+
tables: &ty::TypeckTables::empty(),
396396
live_symbols: box FxHashSet(),
397397
struct_has_extern_repr: false,
398398
ignore_non_const_paths: false,

src/librustc/middle/effect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn type_is_unsafe_function(ty: Ty) -> bool {
5252

5353
struct EffectCheckVisitor<'a, 'tcx: 'a> {
5454
tcx: TyCtxt<'a, 'tcx, 'tcx>,
55-
tables: &'a ty::Tables<'tcx>,
55+
tables: &'a ty::TypeckTables<'tcx>,
5656

5757
/// Whether we're in an unsafe context.
5858
unsafe_context: UnsafeContext,
@@ -245,7 +245,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
245245

246246
let mut visitor = EffectCheckVisitor {
247247
tcx: tcx,
248-
tables: &ty::Tables::empty(),
248+
tables: &ty::TypeckTables::empty(),
249249
unsafe_context: UnsafeContext::new(SafeContext),
250250
};
251251

src/librustc/middle/liveness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ const ACC_USE: u32 = 4;
512512

513513
struct Liveness<'a, 'tcx: 'a> {
514514
ir: &'a mut IrMaps<'a, 'tcx>,
515-
tables: &'a ty::Tables<'tcx>,
515+
tables: &'a ty::TypeckTables<'tcx>,
516516
s: Specials,
517517
successors: Vec<LiveNode>,
518518
users: Vec<Users>,

src/librustc/middle/reachable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn method_might_be_inlined<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
7979
struct ReachableContext<'a, 'tcx: 'a> {
8080
// The type context.
8181
tcx: TyCtxt<'a, 'tcx, 'tcx>,
82-
tables: &'a ty::Tables<'tcx>,
82+
tables: &'a ty::TypeckTables<'tcx>,
8383
// The set of items which must be exported in the linkage sense.
8484
reachable_symbols: NodeSet,
8585
// A worklist of item IDs. Each item ID in this worklist will be inlined
@@ -370,7 +370,7 @@ pub fn find_reachable<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
370370
});
371371
let mut reachable_context = ReachableContext {
372372
tcx: tcx,
373-
tables: &ty::Tables::empty(),
373+
tables: &ty::TypeckTables::empty(),
374374
reachable_symbols: NodeSet(),
375375
worklist: Vec::new(),
376376
any_library: any_library,

src/librustc/ty/context.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub struct GlobalArenas<'tcx> {
6565
trait_def: TypedArena<ty::TraitDef>,
6666
adt_def: TypedArena<ty::AdtDef>,
6767
mir: TypedArena<RefCell<Mir<'tcx>>>,
68-
tables: TypedArena<ty::Tables<'tcx>>,
68+
tables: TypedArena<ty::TypeckTables<'tcx>>,
6969
}
7070

7171
impl<'tcx> GlobalArenas<'tcx> {
@@ -192,7 +192,7 @@ pub struct CommonTypes<'tcx> {
192192
}
193193

194194
#[derive(RustcEncodable, RustcDecodable)]
195-
pub struct Tables<'tcx> {
195+
pub struct TypeckTables<'tcx> {
196196
/// Resolved definitions for `<T>::X` associated paths.
197197
pub type_relative_path_defs: NodeMap<Def>,
198198

@@ -234,9 +234,9 @@ pub struct Tables<'tcx> {
234234
pub fru_field_types: NodeMap<Vec<Ty<'tcx>>>
235235
}
236236

237-
impl<'tcx> Tables<'tcx> {
238-
pub fn empty() -> Tables<'tcx> {
239-
Tables {
237+
impl<'tcx> TypeckTables<'tcx> {
238+
pub fn empty() -> TypeckTables<'tcx> {
239+
TypeckTables {
240240
type_relative_path_defs: NodeMap(),
241241
node_types: FxHashMap(),
242242
item_substs: NodeMap(),
@@ -402,7 +402,7 @@ pub struct GlobalCtxt<'tcx> {
402402
free_region_maps: RefCell<NodeMap<FreeRegionMap>>,
403403
// FIXME: jroesch make this a refcell
404404

405-
pub tables: RefCell<DepTrackingMap<maps::Tables<'tcx>>>,
405+
pub tables: RefCell<DepTrackingMap<maps::TypeckTables<'tcx>>>,
406406

407407
/// Maps from a trait item to the trait item "descriptor"
408408
pub associated_items: RefCell<DepTrackingMap<maps::AssociatedItems<'tcx>>>,
@@ -654,7 +654,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
654654
self.global_arenas.mir.alloc(RefCell::new(mir))
655655
}
656656

657-
pub fn alloc_tables(self, tables: ty::Tables<'gcx>) -> &'gcx ty::Tables<'gcx> {
657+
pub fn alloc_tables(self, tables: ty::TypeckTables<'gcx>) -> &'gcx ty::TypeckTables<'gcx> {
658658
self.global_arenas.tables.alloc(tables)
659659
}
660660

src/librustc/ty/maps.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ dep_map_ty! { ReprHints: ReprHints(DefId) -> Rc<Vec<attr::ReprAttr>> }
4848
dep_map_ty! { Mir: Mir(DefId) -> &'tcx RefCell<mir::Mir<'tcx>> }
4949
dep_map_ty! { ClosureKinds: ItemSignature(DefId) -> ty::ClosureKind }
5050
dep_map_ty! { ClosureTypes: ItemSignature(DefId) -> ty::ClosureTy<'tcx> }
51-
dep_map_ty! { Tables: Tables(DefId) -> &'tcx ty::Tables<'tcx> }
51+
dep_map_ty! { TypeckTables: TypeckTables(DefId) -> &'tcx ty::TypeckTables<'tcx> }

src/librustc/ty/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub use self::sty::TypeVariants::*;
6969

7070
pub use self::contents::TypeContents;
7171
pub use self::context::{TyCtxt, GlobalArenas, tls};
72-
pub use self::context::{Lift, Tables};
72+
pub use self::context::{Lift, TypeckTables};
7373

7474
pub use self::trait_def::{TraitDef, TraitFlags};
7575

@@ -1917,11 +1917,11 @@ impl BorrowKind {
19171917
}
19181918

19191919
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
1920-
pub fn body_tables(self, body: hir::BodyId) -> &'gcx Tables<'gcx> {
1920+
pub fn body_tables(self, body: hir::BodyId) -> &'gcx TypeckTables<'gcx> {
19211921
self.item_tables(self.map.body_owner_def_id(body))
19221922
}
19231923

1924-
pub fn item_tables(self, def_id: DefId) -> &'gcx Tables<'gcx> {
1924+
pub fn item_tables(self, def_id: DefId) -> &'gcx TypeckTables<'gcx> {
19251925
self.tables.memoize(def_id, || {
19261926
if def_id.is_local() {
19271927
// Closures' tables come from their outermost function,

src/librustc_const_eval/check_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn create_e0004<'a>(sess: &'a Session, sp: Span, error_message: String) -> Diagn
6969

7070
struct MatchVisitor<'a, 'tcx: 'a> {
7171
tcx: TyCtxt<'a, 'tcx, 'tcx>,
72-
tables: &'a ty::Tables<'tcx>,
72+
tables: &'a ty::TypeckTables<'tcx>,
7373
param_env: &'a ty::ParameterEnvironment<'tcx>
7474
}
7575

0 commit comments

Comments
 (0)