Commit Graph

128902 Commits

Author SHA1 Message Date
Michael Howell dceb81af1e Deprecate clippy lint 2020-10-02 11:34:14 -07:00
Jonas Schievink 0c5f0b1c69
Rollup merge of #77453 - pietroalbini:ci-no-more-azure, r=Mark-Simulacrum
Stop running macOS builds on Azure Pipelines

The Infrastructure Team agreed to migrate macOS builds to GitHub Actions, so this commit stops running those builders on Azure Pipelines. The GitHub Actions runners are already configured to upload to the production bucket.

We can't still fully remove the Azure Pipelines configuration, as we still need to have that available until no stable releases run any of their builds on Azure Pipelines anymore. I'll open an issue to track fully removing our Azure Pipelines setup once the PR is merged.

r? @Mark-Simulacrum
2020-10-02 20:27:18 +02:00
Jonas Schievink de8d7aa400
Rollup merge of #77444 - estebank:pat-field-label, r=davidtwco
Fix span for incorrect pattern field and add label

Address #73750.
2020-10-02 20:27:16 +02:00
Jonas Schievink 14d8ee3465
Rollup merge of #77442 - pickfire:patch-7, r=scottmcm
Clean up on example doc fixes for ptr::copy

Follow up of #77385

r? @scottmcm
2020-10-02 20:27:14 +02:00
Jonas Schievink edae965048
Rollup merge of #77441 - couchand:2020-10/fix-75504, r=jonas-schievink
Fix AVR stack corruption bug

Updates the Rust LLVM fork to pull in a fix for a stack corruption bug in AVR platform interrupt code lowering.

Fixes #75504

----

It looks like this is also pulling in a register selection fix by @Amanieu and @tambry that hasn't merged yet; I don't see an open PR for that update.
2020-10-02 20:27:13 +02:00
Jonas Schievink 72d275d844
Rollup merge of #77432 - tmiasko:posix-spawn-musl, r=cuviper
Use posix_spawn on musl targets

The posix_spawn had been available in a form suitable for use in a
Command implementation since musl 0.9.12. Use it in a preference to a
fork when possible, to benefit from CLONE_VM|CLONE_VFORK used there.
2020-10-02 20:27:11 +02:00
Jonas Schievink 1e3c7e214a
Rollup merge of #77423 - ecstatic-morse:discriminant-switch-effect-config, r=pnkfelix
Add `-Zprecise-enum-drop-elaboration`

Its purpose is to assist in debugging #77382 and #74551. Passing `-Zprecise-enum-drop-elaboration=no` will turn off the added precision that seems to be causing issues on some platforms. This assumes that we can reproduce #77382 on the latest master. I should have done this earlier. Oh well.

cc @cuviper
r? @pnkfelix
2020-10-02 20:27:09 +02:00
Jonas Schievink cac5352e33
Rollup merge of #77415 - ecstatic-morse:const-checking-async-block, r=oli-obk
Better error message for `async` blocks in a const-context

Improves the error message for the case in #77361.

r? @oli-obk
2020-10-02 20:27:08 +02:00
Jonas Schievink 18ac26d1c5
Rollup merge of #77409 - pickfire:patch-6, r=GuillaumeGomez
Add example for iter chain struct

r? @GuillaumeGomez
2020-10-02 20:27:06 +02:00
Jonas Schievink 2a09c184c0
Rollup merge of #77405 - timvermeulen:iter_advance_by_tracking_issue, r=scottmcm
Add tracking issue of iter_advance_by feature
2020-10-02 20:27:04 +02:00
Jonas Schievink c7c2418227
Rollup merge of #76811 - GuillaumeGomez:doc-alias-name-restriction, r=oli-obk,ollie27
Doc alias name restriction

Fixes #76705.
2020-10-02 20:27:03 +02:00
Jonas Schievink c8eb2059da
Rollup merge of #76739 - davidtwco:issue-75323-non-static-lifetime-in-anonconst, r=varkor
resolve: prohibit anon const non-static lifetimes

Fixes #75323, fixes #74447 and fixes #73375.

This PR prohibits non-static lifetimes in anonymous constants when only the `min_const_generics` feature is enabled. ~~To do so, `to_region_vid`'s `bug!` had to be changed into a delayed bug, which unfortunately required providing it a `TyCtxt`.~~

---
~~While I am happy with how the implementation of the error turned out in `rustc_passes::check_const`,  emitting an error wasn't sufficient to avoid hitting the ICE later. I also tried implementing the error in `rustc_mir::transform::check_consts::validation` and that worked, but it didn't silence the ICE either. To silence the ICE, I changed it to a delayed bug which worked but was more invasive that I would have liked, and required I return an incorrect lifetime. It's possible that this check should be implemented earlier in the compiler to make the invasive changes unnecessary, but I wasn't sure where that would be and wanted to get some feedback first.~~
The approach taken by this PR has been changed to implement the error in name resolution, which ended up being much simpler.

cc @rust-lang/wg-const-eval
r? @lcnr
2020-10-02 20:26:55 +02:00
Jonas Schievink 17c9b710b5
Rollup merge of #76101 - XAMPPRocky:relnotes-.1.47.0, r=Mark-Simulacrum
Update RELEASES.md for 1.47.0

### [Rendered](https://github.com/XAMPPRocky/rust/blob/relnotes-.1.47.0/RELEASES.md)

r? @Mark-Simulacrum
cc @rust-lang/release
2020-10-02 20:26:54 +02:00
Guillaume Gomez 4427b2d52c Update doc alias documentation 2020-10-02 19:26:59 +02:00
Guillaume Gomez 414aecb13e Update tests 2020-10-02 19:26:59 +02:00
Guillaume Gomez fe415ff412 Remove unneeded replace 2020-10-02 19:26:59 +02:00
Guillaume Gomez 84cb71c6fa Forbid some characters to be used as doc alias 2020-10-02 19:26:59 +02:00
Erin Power e34d3bf0dc Update RELEASES.md for 1.47.0 2020-10-02 13:26:42 -04:00
bors be3808108e Auto merge of #77369 - jonas-schievink:validate-storage-liveness, r=wesleywiser
-Zvalidate-mir: Assert that storage is allocated on local use

This extends the MIR validator to check that locals are only used when their backing storage is currently allocated via `StorageLive`.

The result of this is that miscompilations such as https://github.com/rust-lang/rust/issues/77359 are caught and turned into ICEs.

The PR currently fails tests because miscompilations such as https://github.com/rust-lang/rust/issues/77359 are caught and turned into ICEs.

I have confirmed that tests pass (even with `-Zvalidate-mir`) once `SimplifyArmIdentity` is turned into a no-op (except mir-opt tests, of course).
2020-10-02 17:20:13 +00:00
Jonas Schievink c47011f669 Ignore now-broken mir-opt test 2020-10-02 16:50:45 +02:00
Jonas Schievink acc150b2e9 validate: skip debuginfo 2020-10-02 16:50:29 +02:00
Guillaume Gomez d6b838b93a Simplify fd examples 2020-10-02 16:38:15 +02:00
Guillaume Gomez d1d94ba026 Improve E0777 help message 2020-10-02 16:33:44 +02:00
Pietro Albini b9070f3fd4
ci: stop running macOS builds on Azure Pipelines 2020-10-02 16:15:05 +02:00
Jonas Schievink c1a431edc3 validate: storage must be allocated on local use 2020-10-02 16:11:47 +02:00
Mark Rousskov 89fdfe6828 Permit ty::Bool in const generics for v0 mangling 2020-10-02 09:45:48 -04:00
bors a585aaefb6 Auto merge of #77418 - pietroalbini:ci-environment-files, r=Mark-Simulacrum
Switch to environment files to change the environment on GHA

This PR switches our CI to use GitHub's new [environment files](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files) to set environment variables and add items to `$PATH`, as GitHub [plans to disable the old `::set-env` and `::add-path` log commands](https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/) due to a [security issue](https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w).

Our self-hosted runners are on version 2.273.4, so they already have support for this.

r? `@Mark-Simulacrum`
2020-10-02 13:22:26 +00:00
David Wood eacfb2b265
resolve: prohibit anon const non-static lifetimes
This commit modifies name resolution to emit an error when non-static
lifetimes are used in anonymous constants when the `min_const_generics`
feature is enabled.

Signed-off-by: David Wood <david@davidtw.co>
2020-10-02 13:54:25 +01:00
Mark Rousskov 2626b2a8fa Bump version to 1.49.0 2020-10-02 08:39:40 -04:00
Stein Somers 90c8b43bc3 BTreeMap: document DrainFilterInner better 2020-10-02 13:13:28 +02:00
bors 4dedf5edd5 Auto merge of #77396 - wesleywiser:disable-simplifyarmidentity, r=oli-obk
Disable the SimplifyArmIdentity mir-opt

The optimization still has some bugs that need to be worked out
such as #77359.

We can try re-enabling this again after the known issues are resolved.

r? `@oli-obk`
2020-10-02 10:04:46 +00:00
bors 154f1f544d Auto merge of #77029 - ehuss:command-access, r=dtolnay
Add accessors to Command.

This adds some accessor methods to `Command` to provide a way to access the values set when building the `Command`. An example where this can be useful is to display the command to be executed. This is roughly based on the [`ProcessBuilder`](13b73cdaf7/src/cargo/util/process_builder.rs (L105-L134)) in Cargo.

Possible concerns about the API:
- Values with NULs on Unix will be returned as `"<string-with-nul>"`. I don't think it is practical to avoid this, since otherwise a whole separate copy of all the values would need to be kept in `Command`.
- Does not handle `arg0` on Unix. This can be awkward to support in `get_args` and is rarely used. I figure if someone really wants it, it can be added to `CommandExt` as a separate method.
- Does not offer a way to detect `env_clear`. I'm uncertain if it would be useful for anyone.
- Does not offer a way to get an environment variable by name (`get_env`). I figure this can be added later if anyone really wants it. I think the motivation for this is weak, though. Also, the API could be a little awkward (return a `Option<Option<&OsStr>>`?).
- `get_envs` could skip "cleared" entries and just return `&OsStr` values instead of `Option<&OsStr>`. I'm on the fence here. My use case is to display a shell command, and I only intend it to be roughly equivalent to the actual execution, and I probably won't display `None` entries. I erred on the side of providing extra information, but I suspect many situations will just filter out the `None`s.
- Could implement more iterator stuff (like `DoubleEndedIterator`).

I have not implemented new std items before, so I'm uncertain if the existing issue should be reused, or if a new tracking issue is needed.

cc #44434
2020-10-02 07:51:24 +00:00
Mara Bos b1ce7a38a6 Disable condvar::two_mutexes test on non-unix platforms.
Condvars are no longer guaranteed to panic in this case on all
platforms. At least the unix implementation still does.
2020-10-02 09:47:08 +02:00
Mara Bos f3837e788b No longer put windows condvars in a box.
Windows condition variables are movable (while not borrowed) according
to their documentation.
2020-10-02 09:47:08 +02:00
Mara Bos ec69a858e4 No longer put wasm condvars in a box.
These condvars are just an AtomicUsize, so can be moved without
problems.
2020-10-02 09:47:08 +02:00
Mara Bos 7f56a35411 No longer put condvars on the 'unsupported' platform in a box.
These condvars are unsupported and implemented as a ZST, so can be moved
without problems.
2020-10-02 09:47:08 +02:00
Mara Bos 5769a46788 No longer put cloudabi condvars in a box.
Cloudabi condvars may be moved safely.
2020-10-02 09:47:08 +02:00
Mara Bos b181f5a923 Make it possible to have unboxed condvars on specific platforms.
This commit keeps all condvars boxed on all platforms, but makes it
trivial to remove the box on some platforms later.
2020-10-02 09:47:08 +02:00
Mara Bos dc81cbdcb1 No longer put windows mutexes in a box.
Windows SRW locks are movable (while not borrowed) according to their
documentation.
2020-10-02 09:47:08 +02:00
Mara Bos 4f1353e54f No longer put wasm mutexes in a box.
These mutexes are just an AtomicUsize, so can be moved without
problems.
2020-10-02 09:47:08 +02:00
Mara Bos 2f0386771d No longer put mutexes on the 'unsupported' platform in a box.
These mutexes are just a bool (in a cell), so can be moved without
problems.
2020-10-02 09:47:08 +02:00
Mara Bos def5188ca8 No longer put cloudabi mutexes in a box.
Cloudabi mutexes may be moved safely.
2020-10-02 09:47:08 +02:00
Mara Bos 58deb7001d Make it possible to have unboxed mutexes on specific platforms.
This commit keeps all mutexes boxed on all platforms, but makes it
trivial to remove the box on some platforms later.
2020-10-02 09:47:08 +02:00
Mara Bos a8c2d4fc3d Move boxing and mutex checking logic of condvar into sys_common. 2020-10-02 09:47:08 +02:00
Esteban Küber 7d5a6203ec Fix span for incorrect pattern field and add label 2020-10-02 00:44:16 -07:00
Harald Hoyer cadd12b5f0 Implement Make `handle_alloc_error` default to panic (for no_std + liballoc)
Related: https://github.com/rust-lang/rust/issues/66741

Guarded with `#![feature(default_alloc_error_handler)]` a default
`alloc_error_handler` is called, if a custom allocator is used and no
other custom `#[alloc_error_handler]` is defined.

The panic message does not contain the size anymore, because it would
pull in the fmt machinery, which would blow up the code size
significantly.
2020-10-02 09:00:29 +02:00
Ivan Tham ddd19866a7
Clean up on example doc fixes for ptr::copy
Follow up of #77385
2020-10-02 14:44:01 +08:00
Andrew Dona-Couch cd506eaea3 Fix AVR stack corruption bug
Updates the Rust LLVM fork to pull in a fix for a stack corruption
bug in AVR platform interrupt code lowering.

Fixes #75504
2020-10-02 04:07:00 +00:00
varkor 1db05e032d Add various `min_const_generics` regression tests 2020-10-02 02:22:01 +01:00
bors f283d3f02c Auto merge of #77436 - JohnTitor:rollup-65dh7rp, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #76851 (Fix 'FIXME' about using NonZeroU32 instead of u32.)
 - #76979 (Improve std::sys::windows::compat)
 - #77111 (Stabilize slice_ptr_range.)
 - #77147 (Split sys_common::Mutex in StaticMutex and MovableMutex.)
 - #77312 (Remove outdated line from `publish_toolstate` hook)
 - #77362 (Fix is_absolute on WASI)
 - #77375 (rustc_metadata: Do not forget to encode inherent impls for foreign types)
 - #77385 (Improve the example for ptr::copy)
 - #77389 (Fix some clippy lints)
 - #77399 (BTreeMap: use Unique::from to avoid a cast where type information exists)
 - #77429 (Link `new` method in `DefautHasher`s doc)

Failed merges:

r? `@ghost`
2020-10-02 00:48:41 +00:00