Update RLS and Rustfmt
Essentially https://github.com/rust-lang/rust/pull/46929 with only RLS update that fixes the build.
The rls wasn't included in the recent nightlies and a lot of people have been wondering what to do about it, so it'd be good to include the RLS back with the nightly builds as soon as we can.
r? @alexcrichton
rustdoc: add option to abort the process on markdown differences
In the efforts of keeping the std docs free of markdown warnings, this PR adds a stopgap measure to make sure the CI fails if it detects a markdown difference. It does this by adding a new unstable flag to rustdoc, `--deny-render-differences`, which bootstrap then passes to rustdoc when documenting std and friends.
The implementation is... probably not the cleanest option. It currently adds an extra branch after it prints the markdown warnings, which just prints a final line and calls `::std::process::abort(1)`. I did it like this because if it just panics regularly, it looks like an ICE, an even though `html::render::run` returns a Result, that Result is also just `expect`ed immediately, generating the same problem. This way bypasses the panic handler at the top of the thread and looks like a proper failure. Since i don't have a real error Handler there, this is the best i can do without pulling in a real error system for rustdoc.
This PR is blocked on https://github.com/rust-lang/rust/pull/46853, which will fix the rendering differences that were present on master when i started this branch.
rustdoc: Don't try to generate links for modules in import paths
The modules may be private or may even be enums so it would generate dead links.
Fixes#29814Fixes#46766Fixes#46767
Remove an unused import for cfg(not(feature = "backtrace")).
The 'mem' module is not used for this specific code. This was
copy-pasted in by accident when adding RFC 1937 (? in main) support.
update char_indices example to highlight big chars
There was a comment today in IRC where someone thought `char_indices()` and `chars().enumerate()` were equivalent, so i wanted to put an example in the docs where that wasn't true.
r? @rust-lang/docs
Started rebasing @sgrif's PR #33135 off of current master. (Well, actually merging it into a new branch based off current master.)
The following files still need to be fixed or at least reviewed:
- `src/libsyntax/ext/tt/macro_parser.rs`: calls `Parser::parse_lifetime`, which doesn't exist anymore
- `src/libsyntax/parse/parser.rs`: @sgrif added an error message to `Parser::parse_lifetime`. Code has since been refactored, so I just took it out for now.
- `src/libsyntax/ext/tt/transcribe.rs`: This code has been refactored bigtime. Not sure whether @sgrif's changes here are still necessary. Took it out for this commit.
Pass correct span when lowering grouped imports
Solves incorrect diagnostics for unused or deprecated imports. Closes#46576.
Deprecated imports had an existing test which asserted the incorrect span.
That test has been corrected as part of this commit.
Do not expand a derive invocation when derive is not allowed
Closes#46655.
The first commit is what actually closes#46655. The second one is just a refactoring I have done while waiting on a test.
Implements RFC 1937: `?` in `main`
This is the first part of the RFC 1937 that supports new
`Termination` trait in the rust `main` function.
Thanks @nikomatsakis, @arielb1 and all other people in the gitter channel for all your help!
The support for doctest and `#[test]` is still missing, bu as @nikomatsakis said, smaller pull requests are better :)
rustc_trans: support ZST indexing involving uninhabited types.
Fixes#46855 in a minimal way. I decided against supporting non-memory `Rvalue::Len` in this PR (see https://github.com/rust-lang/rust/issues/46855#issuecomment-352965807), as `PlaceContext::Inspect` is also used for `Rvalue::Discriminant`.
r? @arielb1
rustc: don't use union layouts for tagged union enums.
Fixes#46897, fixes#43517 (AFAICT from the testcases).
This PR doesn't add any testcases, we should try to at least get perf ones (cc @Mark-Simulacrum).
I couldn't find an example in those issues where the choice of LLVM array vs struct (with N identical fields) for padding filler types is still needed, *on top of* this change, to prevent excessive LLVM sinking.
r? @arielb1
Make the output of the column! macro 1 based
Fixes #46868.
I didn't add any regression tests as the change already had to change tests inside the codebase.
r? @dtolnay
[MIR Borrowck] Moveck inline asm statements
Closes#45695
New behavior:
* Input operands to `asm!` are moved, direct output operands are initialized.
* Direct, non-read-write outputs match the assignment changes in #46752 (Shallow writes, end borrows).
Solves incorrect diagnostics for unused or deprecated imports. Closes#46576.
Deprecated imports had an existing test which asserted the incorrect span.
That test has been corrected as part of this commit.