Skip to content

Commit 66dd323

Browse files
committed
---
yaml --- r: 210360 b: refs/heads/try c: 4174aa4 h: refs/heads/master v: v3
1 parent b902402 commit 66dd323

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 4420f318080e116dc4bf75a1a3568fe8bf4157b7
5+
refs/heads/try: 4174aa40f40e05195d73d3eb09b12d9359444f5d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc/diagnostics.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -307,18 +307,20 @@ a compile-time constant.
307307

308308
E0308: r##"
309309
This error occurs when the compiler was unable to infer the concrete type of a
310-
variable. This error can occur for several cases, the most common of which is
311-
that there is a mismatch in the expected type that the compiler inferred, and
312-
the actual type that the user defined a variable as.
313-
314-
let a: char = 7; // An integral type can't be contained in a character, so
315-
// there is a mismatch.
316-
317-
let b: u32 = 7; // Either use the right type...
318-
let c = 7; // ...or let the compiler infer it.
319-
320-
let d: char = c; // This also causes a mismatch because c is some sort
321-
// of number whereas d is definitely a character.
310+
variable. This error can occur for several cases, the most common of which is a
311+
mismatch in the expected type that the compiler inferred for a variable's
312+
initializing expression, and the actual type explicitly assigned to the
313+
variable.
314+
315+
For example:
316+
317+
let x: i32 = "I am not a number!";
318+
// ~~~ ~~~~~~~~~~~~~~~~~~~~
319+
// | |
320+
// | initializing expression;
321+
// | compiler infers type `&str`
322+
// |
323+
// type `i32` assigned to variable `x`
322324
"##,
323325

324326
E0309: r##"

0 commit comments

Comments
 (0)