* revise comments explaining why we are using literal or expression
* add unspecified precision comments as we don't guarantee precision
* use expression in `f128::to_degrees()`
* make `f64::to_degrees()` impl consistent with other functions
Revise the extra `r: 'static` constraints added upon universe issues
to add an explanation, and use that explanation during constraint blame
search. This greatly simplifies the region inference logic, which
now does not need to reverse-engineer the event that caused a region
to outlive 'static.
Rewrite the new attribute argument parser
Fixes https://github.com/rust-lang/rust/issues/143940
This rewrites the parser, should improve performance and maintainability.
This can be reviewed commit by commit
This variant doesn't appear to have ever been used.
There's a matching message in `rustc_resolve`, that used to have a FIXME
for porting it to the new diagnostic infrastructure, but that message is
using `feature_err`, which doesn't use buffered lints. Thus, even when
that does get ported, it won't use `BuiltinLintDiag`.
Lint buffering currently relies on a giant enum `BuiltinLintDiag`
containing all the lints that might potentially get buffered. In
addition to being an unwieldy enum in a central crate, this also makes
`rustc_lint_defs` a build bottleneck: it depends on various types from
various crates (with a steady pressure to add more), and many crates
depend on it.
Having all of these variants in a separate crate also prevents detecting
when a variant becomes unused, which we can do with a dedicated type
defined and used in the same crate.
Refactor this to use a dyn trait, to allow using `LintDiagnostic` types
directly.
This requires boxing, but all of this is already on the slow path
(emitting an error).
Because the existing `BuiltinLintDiag` requires some additional types in
order to decorate some variants, which are only available later in
`rustc_lint`, use an enum `DecorateDiagCompat` to handle both the `dyn
LintDiagnostic` case and the `BuiltinLintDiag` case.
rustc_expand: ensure stack in `InvocationCollector::visit_expr`
In Fedora, when we built rustc with PGO on ppc64le, we started failing
the test `issue-74564-if-expr-stack-overflow.rs`. This could also be
reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so
it's probably just unlucky that ppc64le PGO created a large stack frame
somewhere in this recursion path. Adding an `ensure_sufficient_stack`
solves the stack overflow.
Historically, that test and its fix were added in rust-lang/rust#74708,
which was also an `ensure_sufficient_stack` in this area of code at the
time. However, the refactor in rust-lang/rust#92573 basically left that
to the general `MutVisitor`, and then rust-lang/rust#142240 removed even
that ensure call. It may be luck that our tier-1 tested targets did not
regress the original issue across those refactors.
Rollup of 16 pull requests
Successful merges:
- rust-lang/rust#137494 (libstd: init(): dup() subsequent /dev/nulls instead of opening them again)
- rust-lang/rust#144541 (c-variadic: multiple ABIs in the same program for arm)
- rust-lang/rust#144613 (aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON).)
- rust-lang/rust#144780 (Add a method to dump MIR in the middle of MIR building)
- rust-lang/rust#145137 (Consolidate panicking functions in `slice/index.rs`)
- rust-lang/rust#145507 (Refactor attribute parsing to improve ergonomics and some diagnostics)
- rust-lang/rust#145604 (Gate static closures behind a parser feature)
- rust-lang/rust#145648 (Add two tidy dependency checks)
- rust-lang/rust#145661 (update some s390x codegen tests)
- rust-lang/rust#145672 (Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability)
- rust-lang/rust#145689 (Migrate `panic_unwind` to use `cfg_select!`)
- rust-lang/rust#145700 (Handle `ReEarlyParam` in `type_name`.)
- rust-lang/rust#145703 (Remove MIPS targets from CI LLVM platforms)
- rust-lang/rust#145704 (ci: don't cleanup windows disk)
- rust-lang/rust#145705 (remove an `as` cast in prefetch codegen)
- rust-lang/rust#145712 (Update outdated link in bound region comments)
r? `@ghost`
`@rustbot` modify labels: rollup