From b0c8a0324597747b344afc0952f0c3dac2c29eea Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 12 Jun 2019 20:01:27 +0200 Subject: [PATCH] Fix a few typos in type inference chapter Also try to test the top example --- src/doc/rustc-dev-guide/src/type-inference.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/rustc-dev-guide/src/type-inference.md b/src/doc/rustc-dev-guide/src/type-inference.md index a3d012b5dff7..d94c063799dd 100644 --- a/src/doc/rustc-dev-guide/src/type-inference.md +++ b/src/doc/rustc-dev-guide/src/type-inference.md @@ -6,14 +6,14 @@ expression. It is what allows Rust to work with fewer or no type annotations, making things easier for users: -```rust,ignore +```rust fn main() { let mut things = vec![]; - things.push("thing") + things.push("thing"); } ``` -Here, the type of `things` is *inferenced* to be `&str` because that's the value +Here, the type of `things` is *inferred* to be `Vec<&str>` because of the value we push into `things`. The type inference is based on the standard Hindley-Milner (HM) type inference