diff options
| author | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-03 09:49:17 -0700 |
|---|---|---|
| committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-03 09:49:17 -0700 |
| commit | 080ee041e4372a4dec0848e8838bfd2ab019a629 (patch) | |
| tree | 0e87beaaa632d4abf3dfe995a072c2a688b30c2f /src | |
| parent | 71f9e2e4d2dfe781237fd1a5754e82055a11594c (diff) | |
| download | rust-080ee041e4372a4dec0848e8838bfd2ab019a629.tar.gz rust-080ee041e4372a4dec0848e8838bfd2ab019a629.zip | |
Revise long diagnostic
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/diagnostics.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index f43cbb2696d..142f8f5c719 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -1432,8 +1432,9 @@ fn make_child<'elve>(x: &mut &'elve isize, y: &mut &'elve isize) { "##, E0317: r##" -An `if` expression without an `else` block is required to have the type `()`. -This error occurs when the `if` block has a type other than `()`. For example: +This error occurs when an `if` expression without an `else` block is used in a +context where a type other than `()` is expected, for example a `let` +expression: ```compile_fail,E0317 fn main() { @@ -1442,8 +1443,9 @@ fn main() { } ``` -To resolve this error, either add an `else` block having the same type as the -`if` block, or adjust the `if` block so that it has the type `()`. +An `if` expression without an `else` block has the type `()`, so this is a type +error. To resolve it, add an `else` block having the same type as the `if` +block. "##, E0398: r##" |
