Rollup of 11 pull requests
Successful merges:
- #57179 (Update std/lib.rs docs to reflect Rust 2018 usage)
- #57730 (Merge visitors in AST validation)
- #57779 (Recover from parse errors in literal struct fields and incorrect float literals)
- #57793 (Explain type mismatch cause pointing to return type when it is `impl Trait`)
- #57795 (Use structured suggestion in stead of notes)
- #57817 (Add error for trailing angle brackets.)
- #57834 (Stabilize Any::get_type_id and rename to type_id)
- #57836 (Fix some cross crate existential type ICEs)
- #57840 (Fix issue 57762)
- #57844 (use port 80 for retrieving GPG key)
- #57858 (Ignore line ending on older git versions)
Failed merges:
r? @ghost
Ignore line ending on older git versions
On Ubuntu 16.04 git 2.7.4 tries to fix the line ending of `.png` and `.ico` files, and obviously it ruins them. This PR adds an attribute to those files to ignore which line ending they use.
r? @GuillaumeGomez
Fix issue 57762
against a stock LLVM 7. LLVM 7 was released without a necessary fix
for a bug in the DWARF discriminant code.
This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.
Closes#57762
Add error for trailing angle brackets.
Fixes#54521.
This PR adds a error (and accompanying machine applicable
suggestion) for trailing angle brackets on function calls with a
turbofish.
r? @estebank
Update std/lib.rs docs to reflect Rust 2018 usage
Fixes#56544
This paragraph was written for Rust 2015. Since 2018 has been stable for a while I think we can update it.
This commit adds a suggestion when a `=` character is used when
specifying the value of a field in a struct constructor incorrectly
instead of a `:` character.
MonoItemExt#to_string is used for both debug logging and LLVM symbol
name generation. When debugging, we want to print out any type we
encounter, even if it's something weird like GeneratorWitness. However,
during codegen, we still want to error if we encounter an unexpected
type when generating a name.
To resolve this issue, this commit introduces a new 'debug' parameter to
the relevant methods. When set to 'true', it allows any type to be
printed - when set to 'false', it 'bug!'s when encountering an
unexpected type.
This prevents an ICE when enabling debug logging (via RUST_LOG) while
running rustc on generator-related code.
This commit implements a suggestion from @estebank that optimizes the
use of snapshots.
Instead of creating a snapshot for each recursion in `parse_path_segment`
and then replacing `self` with them until the first invocation where if
leading angle brackets are detected, `self` is not replaced and instead the
snapshot is used to inform how parsing should continue.
Now, a snapshot is created in the first invocation that acts as a backup
of the parser state before any generic arguments are parsed (and
therefore, before recursion starts). This backup replaces `self` if after
all parsing of generic arguments has concluded we can determine that
there are leading angle brackets. Parsing can then proceed from the
backup state making use of the now known number of unmatched leading
angle brackets to recover.
Fix Android CI failing to download SDKs
A component of the Android SDK now requires an additional license ([full license text](https://gist.github.com/pietroalbini/28b46a6fed0921d129de58e7aef29f11)) to be accepted before it's possible to use it. The license is dated January 16th 2019, so it's recent.
The weird thing about the license is that it doesn't prompt you to accept it during `sdkmanager --licenses` like all the other ones, but during `sdkmanager platform-tools emulator ...`, and we didn't pipe `yes` to it before this PR.
The PR changes the SDK installation script to accept all the licenses even on the `sdkmanager platform-tools emulator` command.
On Ubuntu 16.04 git 2.7.4 tries to fix the line ending of .png and .ico
files, and obviously it ruins them. This commit adds an attribute to
those files to properly mark them as binary.
Per review comments, this commit switches out the backing
type for Instant on windows to a Duration. Tests all pass,
and the code's a lot simpler (plus it should be portable now,
with the exception of the QueryPerformanceWhatever functions).
Right now we do unit conversions between PerfCounter measurements
and nanoseconds for every add/sub we do between Durations and Instants
on Windows machines. This leads to goofy behavior, like this snippet
failing:
```
let now = Instant::now();
let offset = Duration::from_millis(5);
assert_eq!((now + offset) - now, (now - now) + offset);
```
with precision problems like this:
```
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `4.999914ms`,
right: `5ms`', src\main.rs:6:5
```
To fix it, this changeset does the unit conversion once, when we
measure the clock, and all the subsequent math in u64 nanoseconds.
It also adds an exact associativity test to the `sys/time.rs`
test suite to make sure we don't regress on this in the future.
typeck: remove leaky nested probe during trait object method resolution
addresses #57673 (but not marking with f-x because thats now afflicting beta channel).
Fix#57216