Create the Unstable Book
Part of https://github.com/rust-lang/rust/issues/39588
This isn't done yet. To do:
- [x] import the nightly book contents here
- [ ] possibly write some more chapters
This will _not_ be done before it lands; that's part of the whole unstable thing.
Port the reference to mdbook
Part of #39588.
This is only a work in progress. Still left to do:
- [x] double check contents weren't duplicated/lost with the move to individual pages (I'm going to do this)
- [x] fix up links [and footnotes](https://github.com/rust-lang/rust/pull/39855#issuecomment-280168170) (@frewsxcv has volunteered to help with this)
- [x] change `src/doc/reference.md` to redirect to the book
- [x] move the reference on the doc index to be part of the bookshelf
Turn off Vectorization for Emscripten
When targeting Emscripten, rustc emits Vector Instructions by default. However Web Assembly doesn't support Vector Instructions yet, which causes Binaryen to fail converting the intermediate asm.js code to Web Assembly. While asm.js kind of supports Vector Instructions, they aren't supported by any browser other than Firefox, often meaning that they need to be emulated very slowly. So it should just be turned off
for all Emscripten targets.
Fixes#38558
When targeting Emscripten, rustc emits Vector Instructions by default.
However Web Assembly doesn't support Vector Instructions yet, which
causes Binaryen to fail converting the intermediate asm.js code to Web
Assembly. While asm.js kind of supports Vector Instructions, they
aren't supported by any browser other than Firefox, often meaning that
they need to be emulated very slowly. So it should just be turned off
for all Emscripten targets.
Fixes#38558
When compiletest'ing src/test/mir-opt, check timestamps.
The tests in src/test/mir-opt embed references to generated files. The names of the generated files embed node id's, which will change depending on the content of the original source.
To guard against comparisons against stale output, check the timestamps of the supposed output against the timestamp of the original source (i.e. any output should be at least as new as the source that was recompiled).
Fix#39690.
Reenable linkchecker for books
In some senses, this is a revert of cacb3bc9c7 (diff-b64563d143f859565c8357a28ef81101R212); we disabled linkchecker for the book because the links were added by JavaScript. Now, that's fixed upstream, and so we can re-enable the checker.
This also involves two other fixes: we have to check for `name`s as well as `id`s for links, and the linking algorithm of mdBook changed to the same as rustdoc's, so we change some links back.
~~~This isn't quite ready yet; it's [depending on a PR of mine to mdBook](https://github.com/azerupi/mdBook/pull/209). After that's released, this should be the last of these kinds of shenanigans~~~ 😄
This is good to go 😄
Report full details of inference errors
When the old suggestion machinery was removed by @brson in https://github.com/rust-lang/rust/pull/37057, it was not completely removed. There was a bit of code that had the job of going through errors and finding those for which suggestions were applicable, and it remained, causing us not to emit the full details of such errors. This PR removes that.
I've also added various lifetime tests to the UI test suite (so you can also see the before/after there). I have some concrete thoughts on how to improve these cases and am planning on writing those up in some mentoring issues (@CengizIO has expressed interest in working on those changes, so I plan to work with him on it, at least to start).
cc @jonathandturner
Previously, mdBook used JavaScript to add header links, so we
skipped checking the book. As of
https://github.com/rust-lang/rust/pull/39966, it no longer does,
so we can start checking again.
There is a twist, though: it uses name instead of id, so let's test
for both. They're both valid links anyway, so it's good to have the
checker check anyway.
Rust Book: Generics: Resolving ambiguities
- Add a small section to generics.md to explain how ambiguities in type inference can be resolved using the `::<>` syntax.
- Add links from syntax-index.md and iterators.md.
- Minor edits to iterators.md and structs.md.