[beta] backports
* [beta] Disable SimplifyComparisonIntegral rust-lang/rust#151267
* Use the old homu bors e-mail address again rust-lang/rust#150959
Does not backport other nominated PRs:
* Only use SSA locals in SimplifyComparisonIntegral rust-lang/rust#150925 (replaced with the disablement PR)
* Don't try to evaluate const blocks during constant promotion rust-lang/rust#150557 (backport essentially denied at this point)
* Use realstd current thread static variables in tests rust-lang/rust#150131 (as far as I can tell, this only affects internal std tests and hasn't landed in time for backport)
r? @Mark-Simulacrum
This caused several performance regressions because of existing code
which uses `Read::read` and therefore requires full buffer
initialization. This is particularly a problem when the same buffer is
re-used for multiple read calls since this means it needs to be fully
re-initialized each time.
There is still some benefit to landing the API changes, but we will have
to add private APIs so that the existing infrastructure can
track and avoid redundant initialization.
(cherry picked from commit 4b07875505)
Rollup of 11 pull requests
Successful merges:
- rust-lang/rust#148662 (alloc: Document panics when allocations will exceed max)
- rust-lang/rust#148811 (core docs: rewrite `panic::Location::caller` with visual line/column numbers)
- rust-lang/rust#149101 (Improve mutable-binding suggestion to include name)
- rust-lang/rust#149477 (float::maximum/minimum: make docs more streamlined)
- rust-lang/rust#149547 (library: Rename `IterRange*` to `Range*Iter`)
- rust-lang/rust#149548 (Generate delegation error body when delegation is not resolved)
- rust-lang/rust#149630 (Check identifiers defined in macros when suggesting identifiers hidden by hygiene)
- rust-lang/rust#149647 (Add regression test for 141845)
- rust-lang/rust#149661 (Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.)
- rust-lang/rust#149666 (Add perma-unstable `--print=backend-has-zstd` for use by compiletest)
- rust-lang/rust#149671 (interpret: test SNaN handling of float min/max and update comments)
r? `@ghost`
`@rustbot` modify labels: rollup
interpret: test SNaN handling of float min/max and update comments
Also see https://github.com/rust-lang/rust/pull/149563.
I also renamed these enum variants so they are not almost identical.
Add perma-unstable `--print=backend-has-zstd` for use by compiletest
Tests for `-Zdebuginfo-compression=zstd` need to be skipped if LLVM was built without support for zstd compression.
Currently, compiletest relies on messy and fragile heuristics to detect whether the compiler's LLVM was built with zstd support. But the compiler itself already knows whether LLVM has zstd or not, so it's easier for compiletest to just ask the compiler.
---
Originally I was intending for this to be a `--print=debuginfo-compression` flag that would print out a list of values supported by `-Zdebuginfo-compression=`. I got that working locally, but it was more complex than I was happy with (in both rustc and compiletest), so I decided to cut scope and instead add a very narrow perma-unstable print request instead.
There is always a circularity hazard whenever we ask the compiler-under-test for information about how to test it. But in this case, the underlying compiler code is fairly simple, whereas the previous heuristics were inherently messy and unreliable anyway.
Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.
LLVM added codegen decision making based on RuntimeLibraryInfo. Mirror the change in Rust's codegen.
LLVM reference commit:
04c81a9973.
Add regression test for 141845
close: rust-lang/rust#141845
I saw the `tests/ui/associated-inherent-types` directory, but I felt the current location was a better fit.
Check identifiers defined in macros when suggesting identifiers hidden by hygiene
Fixrust-lang/rust#149604
r? `@JonathanBrouwer` (Since you reviewed the other one related to this)
Generate delegation error body when delegation is not resolved
This PR relates to the delegation feature rust-lang/rust#118212, it fixesrust-lang/rust#144594 ICE.
r? `@petrochenkov`
library: Rename `IterRange*` to `Range*Iter`
There is a weak convention in the ecosystem that `IterFoos` is an iterator yielding items of type `Foo` (e.g. `bitflags` `IterNames`, `hashbrown` `IterBuckets`), while `FooIter` is an iterator over `Foo` from an `.iter()` or `.into_iter()` method (e.g. `memchr` `OneIter`, `regex` `SetMatchesIter`). Rename `IterRange`, `IterRangeInclusive`, and `IterRangeFrom` to `RangeIter`, `RangeInclusiveIter`, and `RangeInclusiveIter` to match this.
Tracking issue: https://github.com/rust-lang/rust/issues/125687 (`new_range_api`)
float::maximum/minimum: make docs more streamlined
This does with `maximum`/`minimum` what https://github.com/rust-lang/rust/pull/149475 did with `max`/`min`: first a self-contained description of the semantics, then comparing with other operations. It also makes the wording consistent with those other functions. Previously we had some of the semantics below the examples for some reason, and we repeated "If one of the arguments is NaN, then NaN is returned"; that has been streamlined as well.
r? `@tgross35`
core docs: rewrite `panic::Location::caller` with visual line/column numbers
no tracking issue
hey, this is my first PR on rust-lang/rust, so hopefully everything goes well.
i noticed the documentation for `core::panic::Location::caller` was kind of unintelligible (and maybe even wrong due to standalone_crate) and filled with magic numbers, so i provided line and column numbers as a visual guidance as to how it should be used.
edit: uh oh, looks like i pushed changes from random commits unrelated to me, what's going on?
edit2: reverted the unintended changes by this pr
alloc: Document panics when allocations will exceed max
Document panics in `String` and `Vec` due to capacity overflowing `isize::MAX`. Correct outdated claims of `usize::MAX` limit.
Fixes https://github.com/rust-lang/rust/issues/148598.
Ping `@lolbinarycat`
misc coercion cleanups and handle safety correctly
r? lcnr
### "remove normalize call"
Fixesrust-lang/rust#132765
If the normalization fails we would sometimes get a `TypeError` containing inference variables created inside of the probe used by coercion. These would then get leaked out causing ICEs in diagnostics logic
### "leak check and lub for closure<->closure coerce-lubs of same defids"
Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/233
```rust
fn peculiar() -> impl Fn(u8) -> u8 {
return |x| x + 1
}
```
the `|x| x + 1` expr has a type of `Closure(?31t)` which we wind up inferring the RPIT to. The `CoerceMany` `ret_coercion` for the whole `peculiar` typeck has an expected type of `RPIT` (unnormalized). When we type check the `return |x| x + 1` expr we go from the never type to `Closure(?31t)` which then participates in the `ret_coercion` giving us a `coerce-lub(RPIT, Closure(?31t))`.
Normalizing `RPIT` gives us some `Closure(?50t)` where `?31t` and `?50t` have been unified with `?31t` as the root var. `resolve_vars_if_possible` doesn't resolve infer vars to their roots so these wind up with different structural identities so the fast path doesn't apply and we fall back to coercing to a `fn` ptr. cc rust-lang/rust#147193 which also fixes this
New solver probably just gets more inference variables here because canonicalization + generally different approach to normalization of opaques. Idk :3
### FCP worthy stuffy
there are some other FCP worthy things but they're in my FCP comment which also contains some analysis of the breaking nature of the previously listed changes in this PR: https://github.com/rust-lang/rust/pull/148602#issuecomment-3503497467
Tests for `-Zdebuginfo-compression=zstd` need to be skipped if LLVM was built
without support for zstd compression.
Currently, compiletest relies on messy and fragile heuristics to detect whether
the compiler's LLVM was built with zstd support. But the compiler itself
already knows whether LLVM has zstd or not, so it's easier for compiletest to
just ask the compiler.