Rollup of 10 pull requests
Successful merges:
- #52946 (Documented impl From on line 367 of libserialize/json.rs)
- #53234 (Remove Travis shutdown debug scripts, and remove CI-specific DNS settings)
- #53313 (Two small improvements)
- #53360 (Addressed #51602)
- #53364 (Warn if the user tries to use GATs)
- #53373 (Tweak unclosed delimiter parser error)
- #53377 (std: Use target_pointer_width for BACKTRACE_ELF_SIZE)
- #53395 (Use #[non_exhaustive] on internal enums)
- #53399 (Tidy: ignore non-Markdown files when linting for the Unstable Book)
- #53412 (syntax_ext: remove leftover span_err_if_not_stage0 macro.)
Originally added in #52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.
Remove Travis shutdown debug scripts, and remove CI-specific DNS settings
Since the cause of the host shutdown (travis-ci/travis-ci#4924) is found, we could revert the shutdown debug attempts to shorten the logs.
Additionally, we're pretty sure a custom DNS (added in will not help travis-ci/travis-ci#9696, so reverting that part of #51420 to reduce CI-specific settings.
syntax_ext: remove leftover span_err_if_not_stage0 macro.
I believe this is the right fix for #53380, although I'm not sure what happened.
My guess is this copy of the macro was accidentally missed when others were removed?
cc @matthewjasper @varkor (please do not put this in a rollup, in case it fails)
Tidy: ignore non-Markdown files when linting for the Unstable Book
Previously, any file would be assumed a `.md`, which is annoying when files like `.DS_STORE` slip in and then cause tidy errors.
Use #[non_exhaustive] on internal enums
This replaces `__Nonexhaustive` variants (and variants thereof) with `#[non_exhaustive]`. These were mostly unstable previously, with the exception of the `cloudabi` enums and `Level` in proc_macro: these were `#[doc(hidden)]`, so clearly intended not to be used directly. It should be safe to replace all of these.
std: Use target_pointer_width for BACKTRACE_ELF_SIZE
The former code used `target.contains("64")` to detect Elf64 targets,
but this is inaccurate in a few cases:
- `s390x-unknown-linux-gnu` is 64-bit
- `sparcv9-sun-solaris` is 64-bit
- `x86_64-unknown-linux-gnux32` is 32-bit
Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH`
to reliably detect 64-bit targets for libbacktrace.
Also update to backtrace-sys 0.1.24 for alexcrichton/backtrace-rs#122.
Addressed #51602Fixed#51602
r? @estebank
here I have addressed the case where `in` was not expected right after `if` block. Speaking of `type ascription` I am not sure if this the best approach which I have implemented. Plus I think one more test case can be added to test `type-ascription` case, though I don't have any at this point of time. I will ping you again if all existing testcases pass.
Two small improvements
In `librustc_apfloat/ieee.rs`, use the iterator.[r]find methods to simplify the code. In `libserialize/json.rs`, make use of the fact that `Vec.last` on an empty `Vec` returns `None` to simplify the code to a single match.
Documented impl From on line 367 of libserialize/json.rs
This is for the impl From mentioned in #51430 assigned to @skade .
Hopefully I didn't miss anything/get anything wrong. I looked over another PR for another part of this same issue to see what the proper formatting was, etc.
Thanks!
TokenStream::extend
Two new insta-stable impls in libproc_macro:
```rust
impl Extend<TokenTree> for TokenStream
impl Extend<TokenStream> for TokenStream
```
`proc_macro::TokenStream` already implements `FromIterator<TokenTree>` and `FromIterator<TokenStream>` so I elected to support the same input types for `Extend`.
**This commit reduces compile time of Serde derives by 60% (takes less than half as long to compile)** as measured by building our test suite:
```console
$ git clone https://github.com/serde-rs/serde
$ cd serde/test_suite
$ cargo check --tests --features proc-macro2/nightly
$ rm -f ../target/debug/deps/libtest_*.rmeta
$ time cargo check --tests --features proc-macro2/nightly
Before: 20.8 seconds
After: 8.6 seconds
```
r? @alexcrichton
Don't accept non-string literals for the format string in writeln
This is to improve diagnostics.
`println` and `eprintln` were already fixed by #52394.
Fixes#30143