diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2020-03-18 21:11:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-18 21:11:07 +0100 |
| commit | 11053bafac5bdb00f37cb040a19779474e778a35 (patch) | |
| tree | 58d06260aa7b94875c1accd4efb6f27753d428e2 /src/librustc_error_codes/error_codes | |
| parent | f509b26a7730d721ef87423a72b3fdf8724b4afa (diff) | |
| parent | b6f61a1f51bd87dce41cf9523a24312f66d06b79 (diff) | |
| download | rust-11053bafac5bdb00f37cb040a19779474e778a35.tar.gz rust-11053bafac5bdb00f37cb040a19779474e778a35.zip | |
Rollup merge of #70112 - Centril:rollup-gpi5tbq, r=Centril
Rollup of 10 pull requests Successful merges: - #67749 (keyword docs for else and inkeyword docs for else and in.) - #69139 (clean up E0308 explanation) - #69189 (Erase regions in writeback) - #69837 (Use smaller discriminants for generators) - #69838 (Expansion-driven outline module parsing) - #69839 (Miri error reform) - #69899 (Make methods declared by `newtype_index` macro `const`) - #69920 (Remove some imports to the rustc crate) - #70075 (Fix repr pretty display) - #70106 (Tidy: fix running rustfmt twice) Failed merges: - #70051 (Allow `hir().find` to return `None`) - #70074 (Expand: nix all fatal errors) r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0308.md | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/librustc_error_codes/error_codes/E0308.md b/src/librustc_error_codes/error_codes/E0308.md index a907ca27297..7d87d54194e 100644 --- a/src/librustc_error_codes/error_codes/E0308.md +++ b/src/librustc_error_codes/error_codes/E0308.md @@ -1,10 +1,6 @@ -This error occurs when the compiler was unable to infer the concrete type of a -variable. It can occur for several cases, the most common of which is a -mismatch in the expected type that the compiler inferred for a variable's -initializing expression, and the actual type explicitly assigned to the -variable. +Expected type did not match the received type. -For example: +Erroneous code example: ```compile_fail,E0308 let x: i32 = "I am not a number!"; @@ -15,3 +11,9 @@ let x: i32 = "I am not a number!"; // | // type `i32` assigned to variable `x` ``` + +This error occurs when the compiler was unable to infer the concrete type of a +variable. It can occur for several cases, the most common of which is a +mismatch in the expected type that the compiler inferred for a variable's +initializing expression, and the actual type explicitly assigned to the +variable. |
