Unsupport the `await!(future)` macro
Unsupport the `await!(future)` "macro" and recognize it in error recovery instead.
The `future.await` syntax has been on nightly since 2019-05-08.
This was 55 days ago which is 1.31 releases ago.
Closes https://github.com/rust-lang/rust/issues/60610.
r? @cramertj
rustc: Stabilize options for pipelined compilation
This commit stabilizes options in the compiler necessary for Cargo to
enable "pipelined compilation" by default. The concept of pipelined
compilation, how it's implemented, and what it means for rustc are
documented in #60988. This PR is coupled with a PR against Cargo
(rust-lang/cargo#7143) which updates Cargo's support for pipelined
compliation to rustc, and also enables support by default in Cargo.
(note that the Cargo PR cannot land until this one against rustc lands).
The technical changes performed here were to stabilize the functionality
proposed in #60419 and #60987, the underlying pieces to enable pipelined
compilation support in Cargo. The issues have had some discussion during
stabilization, but the newly stabilized surface area here is:
* A new `--json` flag was added to the compiler.
* The `--json` flag can be passed multiple times.
* The value of the `--json` flag is a comma-separated list of
directives.
* The `--json` flag cannot be combined with `--color`
* The `--json` flag must be combined with `--error-format=json`
* The acceptable list of directives to `--json` are:
* `diagnostic-short` - the `rendered` field of diagnostics will have a
"short" rendering matching `--error-format=short`
* `diagnostic-rendered-ansi` - the `rendered` field of diagnostics
will be colorized with ansi color codes embedded in the string field
* `artifacts` - JSON blobs will be emitted for artifacts being emitted
by the compiler
The unstable `-Z emit-artifact-notifications` and `--json-rendered`
flags have also been removed during this commit as well.
Closes#60419Closes#60987Closes#60988
std: Fix a failing `fs` test on Windows
In testing 4-core machines on Azure the `realpath_works_tricky` test in
the standard library is failing with "The directory name is invalid". In
attempting to debug this test I was able to reproduce the failure
locally on my machine, and after inspecing the test it I believe is
exploiting Unix-specific behavior that seems to only sometimes work on
Windows. Specifically the test basically executes:
mkdir -p a/b
mkdir -p a/d
touch a/f
ln -s a/b/c ../d/e
ln -s a/d/e ../f
and then asserts that `canonicalize("a/b/c")` and
`canonicalize("a/d/e")` are equivalent to `a/f`. On Windows however the
first symlink is a "directory symlink" and the second is a file symlink.
In both cases, though, they're pointing to files. This means that for
whatever reason locally and on the 4-core environment the call to
`canonicalize` is failing. On Azure today it seems to be passing, and
I'm not entirely sure why. I'm sort of presuming that there's some sort
of internals going on here where there's some global Windows setting
which makes symlinks behavior more unix-like and ignore the directory
hint.
In any case this should keep the test working and also fixes the test
locally for me. It's also worth pointing out that this test was made Windows compatible in https://github.com/rust-lang/rust/pull/31360, a pretty ancient PR at this point.
ci: Skip installing SWIG/xz on OSX
I'm relatively certain that SWIG was only needed for LLDB which is no
longer built, and I'm hoping we can remove the xz install to remove the
reliance on `brew` for our build (which is another point of failure for
flaky networks).
vxworks: Remove Linux-specific comments.
It looks like the VxWorks fork inadvertently left in some Linux-specific workaround comments in `libstd`, these can be removed. Came up when looking into #62516
CC: @BaoshanPang
Properly check the defining scope of existential types
Fixes#52632
Existential types (soon to be 'impl trait' aliases) can either be
delcared at a top-level crate/module scope, or within another item such
as an fn. Previously, we were handling the second case incorrectly when
recursively searching for defining usages - we would check children of
the item, but not the item itself. This lead to us missing closures
that consituted a defining use of the existential type, as their opaque
type instantiations are stored in the TypeckTables of their parent
function.
This commit ensures that we explicitly visit the defining item itself,
not just its children.
Make generic parameters always use modern hygiene
* E0263 (lifetime parameter declared twice in the same scope) now compares modernized identifiers.
* Const parameters are now resolved with modern hygiene.
Closes#58307Closes#60746Closes#61574Closes#62433
Remove mentions of removed `offset_to` method from `align_offset` docs
The `offset_to` method was deleted in https://github.com/rust-lang/rust/pull/52814.
The replacement for the removed method is `wrapping_offset_from`. However, neither method takes an `usize` as argument, so I don't think that it makes sense to mention them.
In testing 4-core machines on Azure the `realpath_works_tricky` test in
the standard library is failing with "The directory name is invalid". In
attempting to debug this test I was able to reproduce the failure
locally on my machine, and after inspecing the test it I believe is
exploiting Unix-specific behavior that seems to only sometimes work on
Windows. Specifically the test basically executes:
mkdir -p a/b
mkdir -p a/d
touch a/f
ln -s a/b/c ../d/e
ln -s a/d/e ../f
and then asserts that `canonicalize("a/b/c")` and
`canonicalize("a/d/e")` are equivalent to `a/f`. On Windows however the
first symlink is a "directory symlink" and the second is a file symlink.
In both cases, though, they're pointing to files. This means that for
whatever reason locally and on the 4-core environment the call to
`canonicalize` is failing. On Azure today it seems to be passing, and
I'm not entirely sure why. I'm sort of presuming that there's some sort
of internals going on here where there's some global Windows setting
which makes symlinks behavior more unix-like and ignore the directory
hint.
In any case this should keep the test working and also fixes the test
locally for me.
I'm relatively certain that SWIG was only needed for LLDB which is no
longer built, and I'm hoping we can remove the xz install to remove the
reliance on `brew` for our build (which is another point of failure for
flaky networks).
Rollup of 6 pull requests
Successful merges:
- #62809 (rustc: Update wasm32 support for LLVM 9)
- #63055 (Various cleanups to save analysis)
- #63076 (Miri: fix determining size of an "extra function" allocation)
- #63077 (cleanup: Remove some language features related to built-in macros)
- #63086 (Ignore test cases that are not supported by vxWorks)
- #63092 (Update `impl Trait` gate issues)
Failed merges:
r? @ghost
Ignore test cases that are not supported by vxWorks
bypass x86stdcall.rs for vxworks
ignore wait-forked-but-failed-child.rs as there is no command 'ps' on vxWorks
ignore process-sigpipe.rs as there is no 'sh' on vxWorks
ignore core-run-destroy.rs as there is no 'cat' and 'sleep' on vxWorks
cleanup: Remove some language features related to built-in macros
They are now library features.
Cleanup after https://github.com/rust-lang/rust/pull/62086.
The unstable book files are moved because tidy complained.
rustc: Update wasm32 support for LLVM 9
This commit brings in a number of minor updates for rustc's support for
the wasm target which has changed in the LLVM 9 update. Notable updates
include:
* The compiler now no longer manually inserts the `producers` section,
instead relying on LLVM to do so. LLVM uses the `llvm.ident` metadata
for the `processed-by` directive (which is now emitted on the wasm
target in this PR) and it uses debuginfo to figure out what `language`
to put in the `producers` section.
* Threaded WebAssembly code now requires different flags to be passed
with LLD. In LLD we now pass:
* `--shared-memory` - required since objects are compiled with
atomics. This also means that the generated memory will be marked as
`shared`.
* `--max-memory=1GB` - required with the `--shared-memory` argument
since shared memories in WebAssembly must have a maximum size. The
1GB number is intended to be a conservative estimate for rustc, but
it should be overridable with `-C link-arg` if necessary.
* `--passive-segments` - this has become the default for multithreaded
memory, but when compiling a threaded module all data segments need
to be marked as passive to ensure they don't re-initialize memory
for each thread. This will also cause LLD to emit a synthetic
function to initialize memory which users will have to arrange to
call.
* The `__heap_base` and `__data_end` globals are explicitly exported
since they're now hidden by default due to the `--export` flags we
pass to LLD.
Fixes#52632
Existential types (soon to be 'impl trait' aliases) can either be
delcared at a top-level crate/module scope, or within another item such
as an fn. Previously, we were handling the second case incorrectly when
recursively searching for defining usages - we would check children of
the item, but not the item itself. This lead to us missing closures
that consituted a defining use of the existential type, as their opaque
type instantiations are stored in the TypeckTables of their parent
function.
This commit ensures that we explicitly visit the defining item itself,
not just its children.
Rollup of 8 pull requests
Successful merges:
- #61856 (Lint attributes on function arguments)
- #62360 (Document that ManuallyDrop::drop should not called more than once)
- #62392 (Update minifier-rs version)
- #62871 (Explicit error message for async recursion.)
- #62995 (Avoid ICE when suggestion span is at Eof)
- #63053 (SystemTime docs: recommend Instant for elapsed time)
- #63081 (tidy: Cleanup the directory whitelist)
- #63088 (Remove anonymous_parameters from unrelated test)
Failed merges:
r? @ghost