Skip to content

Some small fixes #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics/diagnostic-codes.md
Original file line number Diff line number Diff line change
@@ -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 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
Expand Down
2 changes: 1 addition & 1 deletion src/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/queries/profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/rustc-driver-interacting-with-the-ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/traits/hrtb.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<X,F> Foo<X> 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?

Expand Down