Ralf Jung [Sat, 6 Jun 2020 19:57:38 +0000 (21:57 +0200)]
Rollup merge of #72508 - ecstatic-morse:poly-self-ty, r=nikomatsakis
Make `PolyTraitRef::self_ty` return `Binder<Ty>`
This came up during review of #71618. The current implementation is the same as a call to `skip_binder` but harder to audit. Make it preserve binding levels and add a call to `skip_binder` at all use sites so they can be audited as part of #72507.
Ralf Jung [Sat, 6 Jun 2020 19:57:33 +0000 (21:57 +0200)]
Rollup merge of #71796 - RalfJung:from-secs, r=nikomatsakis
de-promote Duration::from_secs
In https://github.com/rust-lang/rust/pull/67531, we removed the `rustc_promotable` attribute from a bunch of `Duration` methods, but not from `Duration::from_secs`. This makes the current list of promotable functions the following (courtesy of @ecstatic-morse):
I feel like the last one stands out a bit here -- the rest are all very core language primitives, and `RawWaker` has a strong motivation for getting a `'static` vtable. But a `&'static Duration`? That seems unlikely. So I propose we no longer promote calls to `Duration::from_secs`, which is what this PR does.
https://github.com/rust-lang/rust/pull/67531 saw zero regressions and I am not aware of anyone complaining that this broke their (non-cratered) code, so I consider it likely the same will be true here, but of course we'd do a crater run.
See [this document](https://github.com/rust-lang/const-eval/blob/master/promotion.md) for some more background on promotion and https://github.com/rust-lang/const-eval/issues/19 for some of the concerns around promoting function calls.
bors [Fri, 5 Jun 2020 18:55:52 +0000 (18:55 +0000)]
Auto merge of #72982 - tblah:riscv-ui-tests, r=estebank
resolve: Sort E0408 errors by Symbol str
This is a request for comments implementing my suggested solution to https://github.com/rust-lang/rust/issues/72913
Previously errors were sorted by Symbol index instead of the string. The indexes are not the same between architectures because Symbols for architecture extensions (e.g. x86 AVX or RISC-V d) are interned before the source file is parsed. RISC-V's naming of extensions after single letters led to it having errors sorted differently for test cases using single letter variable names. Instead sort the errors by the Symbol string so that it is stable across architectures.
While I was at it, there's also 8edb05c2 skipping some ui tests which I think are irrelevant for risc-v.
bors [Fri, 5 Jun 2020 15:21:01 +0000 (15:21 +0000)]
Auto merge of #73025 - Dylan-DPC:rollup-a1uzj5u, r=Dylan-DPC
Rollup of 5 pull requests
Successful merges:
- #72260 (Spell out `Self` in async function return)
- #72996 (Remove unsused `NodeId` related APIs in hir map)
- #73010 (Update RELEASES.md)
- #73017 (Use assert_eq for liballoc test)
- #73019 (add test for #72960)
bors [Thu, 4 Jun 2020 23:17:05 +0000 (23:17 +0000)]
Auto merge of #72901 - ehuss:update-cargo, r=Mark-Simulacrum
Update cargo
9 commits in 9fcb8c1d20c17f51054f7aa4e08ff28d381fe096..40ebd52206e25c7a576ee42c137cc06a745a167a
2020-05-25 16:25:36 +0000 to 2020-06-01 22:35:00 +0000
- Warn if using hash in git URL, Fixes rust-lang/cargo#8241 (rust-lang/cargo#8297)
- reset lockfile information between resolutions (rust-lang/cargo#8274)
- Disable strip_works test on macos. (rust-lang/cargo#8301)
- Fix typo in impl Display for Strip (rust-lang/cargo#8299)
- Add support for rustdoc root URL mappings. (rust-lang/cargo#8287)
- Fix tests with enoent error message on non-english systems. (rust-lang/cargo#8295)
- Fix fingerprinting for lld on Windows with dylib. (rust-lang/cargo#8290)
- Fix a typo (rust-lang/cargo#8289)
- Fix several issues with close_output test. (rust-lang/cargo#8286)
Tom Eccles [Tue, 2 Jun 2020 11:07:43 +0000 (12:07 +0100)]
resolve: Sort E0408 errors by Symbol str
Previously errors were sorted by Symbol index instead of the string. The
indexes are not the same between architectures because Symbols for
architecture extensions (e.g. x86 AVX or RISC-V d) are interned before
the source file is parsed. RISC-V's naming of extensions after single
letters led to it having errors sorted differently for test cases using
single letter variable names. Instead sort the errors by the Symbol
string so that it is stable across architectures.
Dylan DPC [Thu, 4 Jun 2020 10:12:52 +0000 (12:12 +0200)]
Rollup merge of #72964 - sajattack:libc-0.2.71-bump, r=Mark-Simulacrum
Bump libc dependency to latest version (0.2.71)
Hello,
Just a quick version bump PR. The rust-psp group had some changes merged to libc recently but they haven't made it into the compiler. We're looking to remove our forked version from our Xargo.toml. Thanks.
Dylan DPC [Thu, 4 Jun 2020 10:12:51 +0000 (12:12 +0200)]
Rollup merge of #72951 - rust-lang:Camelid-RustThanks, r=Mark-Simulacrum
Add Camelid per request
Email from @camelid:
> HI there,
>
> I’m a new contributor and I just looked at Rust Thanks and noticed that my contributions are listed under two different capitalizations of my name: “Camelid" and “camelid". Could you make them both “Camelid"?
>
> Thanks!
>
> Camelid
Dylan DPC [Thu, 4 Jun 2020 10:12:45 +0000 (12:12 +0200)]
Rollup merge of #72782 - petrochenkov:crtargs, r=varkor
rustc_target: Remove `pre_link_args_crt`
To regain some more control over the definition of `+crt-static` (https://github.com/rust-lang/rust/pull/71586).
After https://github.com/rust-lang/rust/pull/71769 this target option wasn't used anywhere except for VxWorks, and I suspect that for VxWorks its use may be redundant as well.
bors [Thu, 4 Jun 2020 04:38:48 +0000 (04:38 +0000)]
Auto merge of #72618 - Aaron1011:feature/early-sourcemap, r=petrochenkov
Make `SourceMap` available for early debug-printing of `Span`s
Normally, we debug-print `Spans` using the `SourceMap` retrieved from
the global `TyCtxt`. However, we fall back to printing out the `Span`'s
raw fields (instead of a file and line number) when we try to print a
`Span` before a `TyCtxt` is available. This makes debugging early phases
of the compile, such as parsing, much more difficult.
This commit stores a `SourceMap` in `rustc_span::GlOBALS` as a fallback.
When a `TyCtxt` is not available, we try to retrieve one from `GLOBALS`
- only if this is not available do we fall back to the raw field output.
I'm not sure how to write a test for this - however, this can be
verified locally by setting `RUSTC_LOG="rustc_parse=debug"`, and
verifying that the output contains filenames and line numbers.
> HI there,
>
> I’m a new contributor and I just looked at Rust Thanks and noticed that my contributions are listed under two different capitalizations of my name: “Camelid" and “camelid". Could you make them both “Camelid"?
>
> Thanks!
>
> Camelid
Dylan DPC [Wed, 3 Jun 2020 16:05:39 +0000 (18:05 +0200)]
Rollup merge of #72900 - jsgf:no-unused-pathless, r=petrochenkov
Don't count pathless --extern for unused-crate-dependencies warnings
`--extern proc_macro` is used to add the proc_macro crate to the extern
prelude for all procmacros. In general pathless `--extern` only references
sysroot/standard libraries and so should be exempt from
unused-crate-dependencies warnings.
bors [Wed, 3 Jun 2020 12:20:45 +0000 (12:20 +0000)]
Auto merge of #72746 - petrhosek:libunwind-hermetic, r=tmandry
Make libunwind build hermetic
We want to avoid exporting any symbols from Rust's version of libunwind,
and to do so we need to disable visibility annotations to make sure that
the -fvisibility=hidden has effect, and also hide global new/delete.
Dylan DPC [Wed, 3 Jun 2020 00:39:07 +0000 (02:39 +0200)]
Rollup merge of #72902 - cuviper:fuse-covariant, r=nikomatsakis
Add a test to ensure Fuse stays covariant
When #70502 attempted to specialize the data types in `Fuse`, one of the problems we found was that it broke variance. This was also realized when `Fuse` was first added, https://github.com/rust-lang/rust/pull/35656#discussion-diff-74995079, but now this PR adds a test so we don't forget again.
Dylan DPC [Wed, 3 Jun 2020 00:38:59 +0000 (02:38 +0200)]
Rollup merge of #72704 - tblah:remote-testing-fixes, r=Mark-Simulacrum
Remote testing fixes
Improvements for remote testing
- Create a `RUST_TEST_TMPDIR` directory on the remote testing host
- Verbose mode for remote-test-server
- Skip tests which don't support remote testing using `// ignore-remote`
To test:
- Build `remote-test-server` for the target machine and copy it over
- On the target:
``` sh
remote-test-server remote
```
- On the build machine
``` sh
export TEST_DEVICE_ADDR="1.2.3.4:12345"
./x.py test
```
Dylan DPC [Tue, 2 Jun 2020 16:29:59 +0000 (18:29 +0200)]
Rollup merge of #72888 - poliorcetics:improve-read_line-read_until-doc, r=Dylan-DPC
Add a warning about infinite reading in read_(until|line)
Fix for #48788.
This PR adds a warning to [`BufRead::read_line`](https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#method.read_line) and [`BufRead::read_until`](https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#method.read_until) about the possibility of an attack using the behaviour of these functions.
I did not mention a possible fix (using [`Read::take`](https://doc.rust-lang.org/stable/std/io/trait.Read.html#method.take), should I ?
Dylan DPC [Tue, 2 Jun 2020 16:29:57 +0000 (18:29 +0200)]
Rollup merge of #72884 - Julian-Wollersberger:raw_str_error_cleanup, r=petrochenkov
RawString error reporting cleanup
I simplified how errors with raw string are represented in the lexer and reportet in the parser, by using one enum instead of two structs with impls. This makes 70 code lines obsolete.
I also noticed some other things (2nd commit) and added a missing test for the `too many '#' symbols' error.
My original intent was to improve performance, but the only thing I found was to inline some functions in `cursor.rs`. It's effect is barely measurable, though.
There is one open question. Before, the compiler aborts when encountering the `too many '#' symbols` error. Now the lexer says in this case that there are 0 hashes, and then later the parser aborts on the error.
I'm worrying that the parser may be changed to recover and continue, and then later stages will see the wrong numer of hashes and act strange. (eg. the `format!` macro expansion).
Is that possibility important enough today to worry about it?
Tom Eccles [Thu, 28 May 2020 16:32:12 +0000 (17:32 +0100)]
compiletest: Add name directive for remote runners
Allow tests to use
// ignore-remote
to ignore the test when using remote-test-{client,server}. In most
situations this would be covered by
// ignore-cross-compile
but I see no reason that a non-cross compiled remote test runner
shouldn't work.
Tom Eccles [Thu, 28 May 2020 15:27:56 +0000 (16:27 +0100)]
tools/remote-test-{server,client}: support RUST_TEST_TMPDIR
Some tests (e.g. ui-fulldeps/create-dir-all-bare.rs) assume that
RUST_TEST_TMPDIR exists on the system running the test. Expand
remote-test-{server,client} such that a tmp directory is created on the
remote runner and this environment variable will point at it.
bors [Tue, 2 Jun 2020 07:54:38 +0000 (07:54 +0000)]
Auto merge of #72672 - seritools:remote-test-windows, r=Mark-Simulacrum
Make remote-test-client and remote-test-server compatible with windows
`compiletest` and `remote-test-client`:
The command line for `remote-test-client` was changed slightly to allow cross-platform compatible paths. The old way of supplying the support libs was by joining their paths with the executable path
with `:`. This caused Windows-style paths to be split after the directory letter. Now, the number of support libs is provided as a parameter as well, and the support lib paths are split off from the regular args in the client.
`remote-test-server`:
- Marked Unix-only parts as such and implemented Windows alternatives
- On Windows `LD_LIBRARY_PATH` doesn't exist. Libraries are loaded from `PATH` though, so that's the way around it.
- Tiny cleanup: `Command::args`/`envs` instead of manually looping over them
- The temp path for Windows has to be set via environment variable, since there isn't a global temp directory that would work on every machine (as a static string)
bors [Tue, 2 Jun 2020 04:10:49 +0000 (04:10 +0000)]
Auto merge of #72905 - JohnTitor:rollup-phtyo5i, r=JohnTitor
Rollup of 10 pull requests
Successful merges:
- #72775 (Return early to avoid ICE)
- #72795 (Add a test for `$:ident` in proc macro input)
- #72822 (remove trivial calls to mk_const)
- #72825 (Clarify errors and warnings about the transition to the new asm!)
- #72827 (changed *nix to Unix-like)
- #72880 (Clean up E0637 explanation)
- #72886 (Remove allow missing_debug_implementations for MaybeUninit)
- #72889 (rustc: Remove the `--passive-segments` LLD flag on wasm)
- #72891 (Add associated consts MIN/MAX for Wrapping<Int>)
- #72893 (test miri-unleash TLS accesses)