Skip to content

Commit 1e6adad

Browse files
committedJul 17, 2020
Rename TypeckTables to TypeckResults.
·
1.89.01.47.0
1 parent 8534be7 commit 1e6adad

File tree

222 files changed

+1439
-1313
lines changed

Some content is hidden

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

222 files changed

+1439
-1313
lines changed
 

‎src/librustc_driver/pretty.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ where
8080
PpmTyped => {
8181
abort_on_err(tcx.analysis(LOCAL_CRATE), tcx.sess);
8282

83-
let annotation = TypedAnnotation { tcx, maybe_typeck_tables: Cell::new(None) };
83+
let annotation = TypedAnnotation { tcx, maybe_typeck_results: Cell::new(None) };
8484
tcx.dep_graph.with_ignore(|| f(&annotation, tcx.hir().krate()))
8585
}
8686
_ => panic!("Should use call_with_pp_support"),
@@ -305,16 +305,18 @@ impl<'a> pprust::PpAnn for HygieneAnnotation<'a> {
305305

306306
struct TypedAnnotation<'tcx> {
307307
tcx: TyCtxt<'tcx>,
308-
maybe_typeck_tables: Cell<Option<&'tcx ty::TypeckTables<'tcx>>>,
308+
maybe_typeck_results: Cell<Option<&'tcx ty::TypeckResults<'tcx>>>,
309309
}
310310

311311
impl<'tcx> TypedAnnotation<'tcx> {
312-
/// Gets the type-checking side-tables for the current body.
312+
/// Gets the type-checking results for the current body.
313313
/// As this will ICE if called outside bodies, only call when working with
314314
/// `Expr` or `Pat` nodes (they are guaranteed to be found only in bodies).
315315
#[track_caller]
316-
fn tables(&self) -> &'tcx ty::TypeckTables<'tcx> {
317-
self.maybe_typeck_tables.get().expect("`TypedAnnotation::tables` called outside of body")
316+
fn typeck_results(&self) -> &'tcx ty::TypeckResults<'tcx> {
317+
self.maybe_typeck_results
318+
.get()
319+
.expect("`TypedAnnotation::typeck_results` called outside of body")
318320
}
319321
}
320322

@@ -338,13 +340,13 @@ impl<'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'tcx> {
338340

339341
impl<'tcx> pprust_hir::PpAnn for TypedAnnotation<'tcx> {
340342
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested) {
341-
let old_maybe_typeck_tables = self.maybe_typeck_tables.get();
343+
let old_maybe_typeck_results = self.maybe_typeck_results.get();
342344
if let pprust_hir::Nested::Body(id) = nested {
343-
self.maybe_typeck_tables.set(Some(self.tcx.body_tables(id)));
345+
self.maybe_typeck_results.set(Some(self.tcx.typeck_body(id)));
344346
}
345347
let pp_ann = &(&self.tcx.hir() as &dyn hir::intravisit::Map<'_>);
346348
pprust_hir::PpAnn::nested(pp_ann, state, nested);
347-
self.maybe_typeck_tables.set(old_maybe_typeck_tables);
349+
self.maybe_typeck_results.set(old_maybe_typeck_results);
348350
}
349351
fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) {
350352
if let pprust_hir::AnnNode::Expr(_) = node {
@@ -356,7 +358,7 @@ impl<'tcx> pprust_hir::PpAnn for TypedAnnotation<'tcx> {
356358
s.s.space();
357359
s.s.word("as");
358360
s.s.space();
359-
s.s.word(self.tables().expr_ty(expr).to_string());
361+
s.s.word(self.typeck_results().expr_ty(expr).to_string());
360362
s.pclose();
361363
}
362364
}

‎src/librustc_hir/hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ pub enum ExprKind<'hir> {
15711571
/// To resolve the called method to a `DefId`, call [`type_dependent_def_id`] with
15721572
/// the `hir_id` of the `MethodCall` node itself.
15731573
///
1574-
/// [`type_dependent_def_id`]: ../ty/struct.TypeckTables.html#method.type_dependent_def_id
1574+
/// [`type_dependent_def_id`]: ../ty/struct.TypeckResults.html#method.type_dependent_def_id
15751575
MethodCall(&'hir PathSegment<'hir>, Span, &'hir [Expr<'hir>], Span),
15761576
/// A tuple (e.g., `(a, b, c, d)`).
15771577
Tup(&'hir [Expr<'hir>]),
@@ -1659,7 +1659,7 @@ pub enum ExprKind<'hir> {
16591659
///
16601660
/// To resolve the path to a `DefId`, call [`qpath_res`].
16611661
///
1662-
/// [`qpath_res`]: ../rustc_middle/ty/struct.TypeckTables.html#method.qpath_res
1662+
/// [`qpath_res`]: ../rustc_middle/ty/struct.TypeckResults.html#method.qpath_res
16631663
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
16641664
pub enum QPath<'hir> {
16651665
/// Path to a definition, optionally "fully-qualified" with a `Self`

0 commit comments

Comments
 (0)
Please sign in to comment.