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
```
A merge in #24523 broke the explanation for E0303. This commit restores the previous version and also removes an erroneous `&` (which had nothing to do with the merge).
Yet another attempt to make the prose on the std crate page
clearer and more informative.
This does a lot of things: tightens up the opening, adds useful links
(including a link to the search bar), offers guidance on how to use
the docs, and expands the prelude docs as a useful newbie entrypoint.
r? @steveklabnik cc @aturon
This help people using keyboard navigation or with disabilities to
easily browse through pagination. For example, in Vimium, a reader can
do `[[` or `]]` to browse through the pages.
Expands E0201 to be used for any duplicate associated items, not just duplicate
methods/functions. It also correctly detects when two different kinds of items
(like a constant and a method) have the same name.
Fixes#23969.
Tidy is still run first for failing fast on the easy stuff.
To accomplish this we have travis actually persist ccache across builds. This
has LLVM built within 6 minutes, and all of stage1 built within 18.
Caching should work on fresh PRs (cache acquired from the master branch).
Because all we persist is ccache, there is minimal danger of persisting corrupt
build state.
I had to mangle `configure` a bit to make --enable-ccache work when custom
compilers are provide via CC and CXX.
Grammatical update (and passive -> active, but I'm not sure if "Rust" is often used as a subject in the book; feel free to revert that part for style, but keep the subject-verb agreement)
r? @steveklabnik
The current nonzero side padding of `code` tags is good for legibility in paragraphs and lists; however, it introduces an awkward indentation to `pre` tags. Specifically, when a `pre` tag contains preformatted text with multiple lines, the fist line gets pushed slightly to the right, running the vertical alignment. An example can be seen [here](http://doc.rust-lang.org/std/fmt/#syntax). I propose setting the padding to zero for `code`s contained in `pre`s.
Regards,
Ivan
Yet another attempt to make the prose on the std crate page
clearer and more informative.
This does a lot of things: tightens up the opening, adds useful links
(including a link to the search bar), offers guidance on how to use
the docs, and expands the prelude docs as a useful newbie entrypoint.
Since Apple LLVM no longer reports which version of LLVM it's based off (starting with 7.0.0), I believe it's time to start checking Apple LLVM versions directly.
The changes in this pull request update the `configure` script to check "Apple LLVM" versions independently if no "based off" version can be found. If a "based off" version is included, however, it will be preferred.
(This is a less hacky version of #26653)
This PR will enable RUSTC to generate PDB debuginfo files when targeting the MSVC toolchain. Mind that these are not full featured PDB files -- they just contain line tables, so you can get proper backtraces and step through your code, but variable values can't be inspected. We are just levering (LLVM's current support)[http://clang.llvm.org/docs/MSVCCompatibility.html] for creating Windows debuginfo. When LLVM's support gets better, we should benefit from that too without much effort.
I also wanted to include some kind of auto test with this PR but I could not get the `rmake` tests to work properly when targeting MSVC.
EDIT:
Closes#19533
When building for AArch64/Linux, __morestack ends up in the .note.GNU-stack section,
which causes missing references for the linker. By using the func/endfunc macros
from macros.S we get __morestack right to .text (and a bit more on the side).
Currently errorck yields bogus `duplicate error code` messages when an error code occurs inside of a long diagnostic message (see https://github.com/rust-lang/rust/pull/26982), because errorck just goes line by line checking for error codes and recording them all.
A simplistic approach to fixing this is just to detect the beginning of a long diagnostic raw string literal (`r##"`) and skip lines until the end of the raw string literal is encountered. I'm not completely confident in this approach, but I think a more robust approach would be more complicated and I wanted to get feedback before pursuing that.
Grammatical update (and passive -> active, but I'm not sure if "Rust" is often used as a subject in the book; feel free to revert that part for style, but keep the subject-verb agreement)
... matching the existing Index impls.
There is no reason not to if String implement DerefMut.
The code removed in `src/librustc/middle/effect.rs` was added in #9750
to prevent things like `s[0] = 0x80` where `s: String`,
but I belive became unnecessary when the Index(Mut) traits were introduced.