That way, callers don't need to repeat "let's add this to sm manually
for tracking dependencies" trick.
It should make it easier to switch to using `FileLoader` for binary
files in the future as well
Reduce the genericity of closures in the iterator traits
By default, closures inherit the generic parameters of their scope,
including `Self`. However, in most cases, the closures used to implement
iterators don't need to be generic on the iterator type, only its `Item`
type. We can reduce this genericity by redirecting such closures through
local functions.
This does make the closures more cumbersome to write, but it will
hopefully reduce duplication in their monomorphizations, as well as
their related type lengths.
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
The remap-debuginfo config option remaps paths in most crates, but it
does not apply to proc-macros, so they are still non-reproducible.
This patch fixes that.
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.