Currently, we only point at the span of the macro argument. When the
macro call is itself generated by another macro, this can make it
difficult or impossible to determine which macro is responsible for
producing the error.
String::remove_matches O(n^2) -> O(n)
Copy only non-matching bytes. Replace collection of matches into a
vector with iteration over rejections, exploiting the guarantee that we
mutate parts of the haystack that have already been searched over.
r? `@joshtriplett`
This commit fixes an issue not found during #84988 where rustdoc is used
to document cross-platform intrinsics but it was requiring that
functions which use `#[target_feature]` are `unsafe` erroneously, even
if they're WebAssembly specific. Rustdoc today, for example, already has
a special case where it enables annotations like
`#[target_feature(enable = "simd128")]` on platforms other than
WebAssembly. The purpose of this commit is to relax the "require all
`#[target_feature]` functions are `unsafe`" requirement for all targets
whenever rustdoc is running, enabling all targets to fully document
other targets, such as WebAssembly, where intrinsics functions aren't
always `unsafe`.
During the 1.52 release process we had to deal with some commits that
passed the test suite on the nightly branch but failed on the beta or
stable branch. In that case it was due to some UI tests including the
channel name in the output, but other changes might also be dependent on
the channel.
This commit adds a new CI job that runs the Linux x86_64 test suite with
the stable branch, ensuring nightly changes also work as stable.
The session-derive-errors test ensures the internal SessionDiagnostic
derive macro outputs the right error messages when misused.
The macro relies on the proc_macro2 crate though, which changes its span
behavior depending on whether the channel is nightly or not. This caused
test failures when bumping the channel from nightly to beta/stable.
Since SessionDiagnostic is internal-only we don't care about its
diagnostics quality outside of nightly, as the compiler itself is
developed on nightly. Thus the easiest solution is to ignore that test
on the beta and stable channels.
This also implements `// only-{channel}` and `// ignore-{channel}` in
compiletest to properly support the change.
Rollup of 6 pull requests
Successful merges:
- #84262 (Fix ICE during type layout when there's a `[type error]`)
- #85973 (Replace a `match` with an `if let`)
- #85996 (rustbuild: take changes to the standard library into account for `download-rustc`)
- #86016 (Unify duplicate linker_and_flavor methods in rustc_codegen_{cranelift,ssa}.)
- #86025 (Remove the install prefix from the rpath set when using -Crpath)
- #86081 (Use `try_into` instead of asserting manually)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Remove the install prefix from the rpath set when using -Crpath
It was broken anyway for rustup installs and nobody seems to have noticed.
Fixes https://github.com/rust-lang/rust/issues/82392
Unify duplicate linker_and_flavor methods in rustc_codegen_{cranelift,ssa}.
The two methods were exactly the same so this removes the cranelift copy. This will help make sure both they don't get out of sync.
rustbuild: take changes to the standard library into account for `download-rustc`
Previously, changing the standard library with `download-rustc =
"if-unchanged"` would incorrectly reuse the cached compiler and standard
library from CI, which was confusing and led to incorrect test failures
or successes.
r? `@Mark-Simulacrum`
Fix ICE during type layout when there's a `[type error]`
Fixes#84108.
Based on estebank's [comment], except I used `delay_span_bug` because it
should work in more cases, and I think it expresses its intent more
clearly.
r? `@estebank`
[comment]: https://github.com/rust-lang/rust/issues/84108#issuecomment-818916848
Driver improvements
This PR contains a couple of cleanups for the driver and a few small improvements for the custom codegen backend interface. It also implements `--version` and `-Cpasses=list` support for custom codegen backends.
Rollup of 8 pull requests
Successful merges:
- #83433 (Pass --cfg=bootstrap for proc macros built by stage0)
- #84940 (Don't run sanity checks for `x.py setup`)
- #85912 (Use `Iterator::any` and `filter_map` instead of open-coding them)
- #85965 (Remove dead code from `LocalAnalyzer`)
- #86010 (Fix two ICEs in the parser)
- #86040 (Fix display for search results)
- #86058 (Remove `_` from E0121 diagnostic suggestions)
- #86077 (Fix corrected example in E0759.md)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
This patch fixes tests from failing that were matching on `Box<Any>`,
which was the old panic message. Since the new panic message is `Box<dyn
Any>`, the tests have been updated to match against this instead.