Rollup of 11 pull requests
Successful merges:
- #62984 (Add lint for excess trailing semicolons)
- #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`)
- #63490 (libsyntax: cleanup and refactor `pat.rs`)
- #63507 (When needing type annotations in local bindings, account for impl Trait and closures)
- #63509 (Point at the right enclosing scope when using `await` in non-async fn)
- #63528 (syntax: Remove `DummyResult::expr_only`)
- #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`)
- #63542 (Add NodeId for Arm, Field and FieldPat)
- #63543 (Merge Variant and Variant_)
- #63560 (move test that shouldn't be in test/run-pass/)
- #63570 (Adjust tracking issues for `MaybeUninit<T>` gates)
Failed merges:
r? @ghost
move test that shouldn't be in test/run-pass/
We no longer test `src/test/run-pass/`; the proper way now is `// run-pass` in `src/test/ui/`
r? @petrochenkov
expand: Unimplement `MutVisitor` on `MacroExpander`
Each call to `fully_expand_fragment` is something unique, interesting, and requiring attention.
It represents a "root" of expansion and its use means that something unusual is happening, like eager expansion or expansion performed outside of the primary expansion pass.
So, it shouldn't hide under a generic visitor call.
Also, from all the implemented visitor methods only two were actually used.
cc https://github.com/rust-lang/rust/pull/63468#discussion_r313504119
syntax: Remove `DummyResult::expr_only`
The effect is that if a built-in macro both returns an erroneous AST fragment and is used in unexpected position, then the incorrect position error won't be reported.
This combination of two errors should be rare and isn't worth an extra field that makes people ask questions in comments.
(There wasn't even a test making sure it worked.)
Addresses https://github.com/rust-lang/rust/pull/63468#discussion_r313504644
r? @estebank
RELEASES.md: ? is one of three Kleene operators
The slash and quotes in ?/“Kleene” appeared to define “Kleene” as the name for the `?` operator, which is not the case. Rust has three Kleene operators `*`, `+`, `?`.
([Pointed out](https://www.reddit.com/r/rust/comments/cprt0z/rust_1370_prerelease_testing/ewr90y3/) by /u/Sharlinator on Reddit.)
Provide map_ok and map_err method for Poll<Option<Result<T, E>>>
Currently `map_ok` and `map_err` methods are given for `Poll<Result<T, E>>`.
This PR adds these methods for `Poll<Option<Result<T, E>>>` as they are helpful in stream building code.
ci: add a check for clock drift
Recently we encountered multiple spurious failures where the crates.io
certificate was reported as expired, even though it's currently due to
expire in a few months. This adds some code to our CI to check for clock
drifts, to possibly find the cause or rule out a bad VM clock.
cc https://github.com/rust-lang/rust/issues/63510
r? @Mark-Simulacrum
handle elision in async fn correctly
We now always make fresh lifetimne parameters for all elided
lifetimes, whether they are in the inputs or outputs. But then
we generate `'_` in the case of elided lifetimes from the outputs.
Example:
```rust
async fn foo<'a>(x: &'a u32) -> &u32 { .. }
```
becomes
```rust
type Foo<'a, 'b> = impl Future<Output = &'b u32>;
fn foo<'a>(x: &'a u32) -> Foo<'a, '_>
```
Fixes#63388
improve DiagnosticBuilder docs
Cc @estebank @oli-obk
Is there any way to do something like `span_note` but with a label attached to the span? I thought `.span_note().span_label()` would do it, but no, that does not work.
ci: move mirrors to their standalone bucket
Currently mirrors are stored in the rust-lang-ci2 S3 bucket along with
CI toolchains. This is problematic for multiple reasons:
- CI IAM credentials are allowed to both edit and delete those files.
A malicious user gaining access to those credentials would be able to
change our mirrored dependencies, possibly compromising the compiler.
- Contents of the rust-lang-ci2 bucket are disposable except for the
mirrors' content. When we implement backups for S3 buckets we'd have
to replicate just that part of the bucket, complicating the backup
logic and increasing the chance of mistakes. A standalone bucket will
be way easier to backup.
This commit switches our CI to use the new rust-lang-ci-mirrors bucket.
r? @alexcrichton
syntax: account for CVarArgs being in the argument list.
Fixes#63430 by testing for `1` argument (the `CVarArgs` itself) instead of `0`.
Note that the error has basically been impossible to trigger since the change that caused #63430, so perhaps we need an audit of untested errors.
Also, this check probably belongs in AST validation/HIR lowering, but I'd rather fix it in place for now.
r? @petrochenkov cc @dlrobertson
Implement Clone, Display for ascii::EscapeDefault
This will mimic the same behaviour as the `char` version; `Display`ing the iterator will give its string representation without advancing it.
typeck: Prohibit RPIT types that inherit lifetimes
Part of #61949.
This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.
cc @nikomatsakis
Each call to `fully_expand_fragment` is something unique, interesting, and requiring attention.
It represents a "root" of expansion and its use means that something unusual is happening, like eager expansion or expansion performed outside of the primary expansion pass.
So, it shouldn't be hide under a generic visitor call.
Also, from all the implemented visitor methods only two were actually used.
The slash and quotes in ?/“Kleene” appeared to define “Kleene” as the
name for the ? operator, which is not the case. Rust has three Kleene
operators *, +, ?.
(Pointed out by /u/Sharlinator on Reddit.)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>