From 3e7b0ddc4cd9630770601896cb44f5ca5959226f Mon Sep 17 00:00:00 2001 From: Takayuki Nakata Date: Tue, 11 Aug 2020 09:08:34 +0900 Subject: [PATCH 1/3] Fix some typos --- src/diagnostics.md | 2 +- src/diagnostics/diagnostic-codes.md | 2 +- src/traits/hrtb.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diagnostics.md b/src/diagnostics.md index 432ea8903..5ad2fbb32 100644 --- a/src/diagnostics.md +++ b/src/diagnostics.md @@ -58,7 +58,7 @@ multiple sentences are _needed_: error: the fobrulator needs to be krontrificated ``` -When code or an identifier must appear in an message or label, it should be +When code or an identifier must appear in a message or label, it should be surrounded with single acute accents \`. ### Error explanations diff --git a/src/diagnostics/diagnostic-codes.md b/src/diagnostics/diagnostic-codes.md index 0e923c5e1..401f2f785 100644 --- a/src/diagnostics/diagnostic-codes.md +++ b/src/diagnostics/diagnostic-codes.md @@ -1,5 +1,5 @@ # Diagnostic Codes -We generally try assign each error message a unique code like `E0123`. These +We generally try to assign each error messages a unique code like `E0123`. These codes are defined in the compiler in the `diagnostics.rs` files found in each crate, which basically consist of macros. The codes come in two varieties: those that have an extended write-up, and those that do not. Whenever possible, if you diff --git a/src/traits/hrtb.md b/src/traits/hrtb.md index 81391f7ae..c0ca318e6 100644 --- a/src/traits/hrtb.md +++ b/src/traits/hrtb.md @@ -107,7 +107,7 @@ impl Foo for F } ``` -Now let's say we have a obligation `Baz: for<'a> Foo<&'a isize>` and we match +Now let's say we have an obligation `Baz: for<'a> Foo<&'a isize>` and we match this impl. What obligation is generated as a result? We want to get `Baz: for<'a> Bar<&'a isize>`, but how does that happen? From b20058aa6d12ceb117bf8696a0205faf2611807d Mon Sep 17 00:00:00 2001 From: Takayuki Nakata Date: Tue, 11 Aug 2020 21:41:01 +0900 Subject: [PATCH 2/3] Update from `typeck_tables_of` to `typeck` --- src/overview.md | 2 +- src/queries/profiling.md | 2 +- src/rustc-driver-interacting-with-the-ast.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/overview.md b/src/overview.md index e97fba6b9..5bcf26911 100644 --- a/src/overview.md +++ b/src/overview.md @@ -367,7 +367,7 @@ For more details on bootstrapping, see - Guide: [Type Inference](https://rustc-dev-guide.rust-lang.org/type-inference.html) - Guide: [The ty Module: Representing Types](https://rustc-dev-guide.rust-lang.org/ty.html) (semantics) - Main entry point (type inference): [`InferCtxtBuilder::enter`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxtBuilder.html#method.enter) - - Main entry point (type checking bodies): [the `typeck_tables_of` query](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.typeck_tables_of) + - Main entry point (type checking bodies): [the `typeck` query](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.typeck) - These two functions can't be decoupled. - The Mid Level Intermediate Representation (MIR) - Guide: [The MIR (Mid level IR)](https://rustc-dev-guide.rust-lang.org/mir/index.html) diff --git a/src/queries/profiling.md b/src/queries/profiling.md index 8c6050da2..593d0b385 100644 --- a/src/queries/profiling.md +++ b/src/queries/profiling.md @@ -282,7 +282,7 @@ We explain each term in more detail: providers may nest; see [trace of queries](#trace-of-queries) for more information about this nesting structure. _Example providers:_ - - `typeck_tables_of` -- Typecheck a Def ID; produce "tables" of type + - `typeck` -- Typecheck a Def ID; produce "tables" of type information. - `borrowck` -- Borrow-check a Def ID. - `optimized_mir` -- Generate an optimized MIR for a Def ID; produce MIR. diff --git a/src/rustc-driver-interacting-with-the-ast.md b/src/rustc-driver-interacting-with-the-ast.md index 0cdc84393..21d03bbb7 100644 --- a/src/rustc-driver-interacting-with-the-ast.md +++ b/src/rustc-driver-interacting-with-the-ast.md @@ -32,7 +32,7 @@ rustc_interface::run_compiler(config, |compiler| { if let Some(expr) = local.init { let hir_id = expr.hir_id; // hir_id identifies the string "Hello, world!" let def_id = tcx.hir().local_def_id(item.hir_id); // def_id identifies the main function - let ty = tcx.typeck_tables_of(def_id).node_type(hir_id); + let ty = tcx.typeck(def_id).node_type(hir_id); println!("{:?}: {:?}", expr, ty); // prints expr(HirId { owner: DefIndex(3), local_id: 4 }: "Hello, world!"): &'static str } } From 8ce3d057e861983a7edb0fbaabb8310e2b3d6de0 Mon Sep 17 00:00:00 2001 From: Takayuki Nakata Date: Wed, 12 Aug 2020 08:12:05 +0900 Subject: [PATCH 3/3] Fix comment Review comment: `This should still be 'message': 'each message' refers to a single one.` --- src/diagnostics/diagnostic-codes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnostics/diagnostic-codes.md b/src/diagnostics/diagnostic-codes.md index 401f2f785..e0d144bfc 100644 --- a/src/diagnostics/diagnostic-codes.md +++ b/src/diagnostics/diagnostic-codes.md @@ -1,5 +1,5 @@ # Diagnostic Codes -We generally try to assign each error messages a unique code like `E0123`. These +We generally try to assign each error message a unique code like `E0123`. These codes are defined in the compiler in the `diagnostics.rs` files found in each crate, which basically consist of macros. The codes come in two varieties: those that have an extended write-up, and those that do not. Whenever possible, if you