diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-07-16 10:49:08 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-07-16 10:49:08 +0530 |
| commit | a4060d02cb69e9fe138cf523b44f73aed1603c66 (patch) | |
| tree | 4fd65eb1d4c313a1747bba2ba3980e2e65e29040 /src/rustllvm/RustWrapper.cpp | |
| parent | 62bb71e83a77c019bcdffa5c2c583fcb515f4bb8 (diff) | |
| parent | 2e1f75acc48ba084f5bd24ec75ec831de6a5677a (diff) | |
| download | rust-a4060d02cb69e9fe138cf523b44f73aed1603c66.tar.gz rust-a4060d02cb69e9fe138cf523b44f73aed1603c66.zip | |
Rollup merge of #27020 - goyox86:goyox86/fix-error-handling-snippet, r=steveklabnik
This PR fixes a snippet of code on the error handling chapter of \"The Rust Programming Language\".
//cc @steveklabnik
The docs state that trying to compile the snippet will yield the following error:
```bash
anon>:13:5: 20:6 error: non-exhaustive patterns: `_` not covered [E0004]
```
But instead the error received is:
```bash
<anon>:22:46: 22:56 error: unresolved name `NewRelease`
<anon>:22 std::io::println(descriptive_probability(NewRelease));
^~~~~~~~~~
<anon>:22:5: 22:21 error: unresolved name `std::io::println`
<anon>:22 std::io::println(descriptive_probability(NewRelease));
^~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
playpen: application terminated with error code 101
```
After applying this PR the expected error is returned:
```bash
anon>:13:5: 20:6 error: non-exhaustive patterns: `_` not covered [E0004]
<anon>:13 match probability(&event) {
<anon>:14 1.00 => \"certain\",
<anon>:15 0.00 => \"impossible\",
<anon>:16 0.00 ... 0.25 => \"very unlikely\",
<anon>:17 0.25 ... 0.50 => \"unlikely\",
<anon>:18 0.50 ... 0.75 => \"likely\",
...
<anon>:13:5: 20:6 help: see the detailed explanation for E0004
error: aborting due to previous error
```
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
