Commit graph

312600 commits

Author SHA1 Message Date
bors
646a3f8c15 Auto merge of #149125 - zachs18:btreemap-eq-perf, r=workingjubilee
In `BTreeMap::eq`, do not compare the elements if the sizes are different.

Reverts rust-lang/rust#147101 in library/alloc/src/btree/

rust-lang/rust#147101 replaced some instances of code like `a.len() == b.len() && a.iter().eq(&b)` with just `a.iter().eq(&b)`, but the optimization that PR introduced only applies for `TrustedLen` iterators, and `BTreeMap`'s itertors are not `TrustedLen`, so this theoretically regressed perf for comparing large `BTreeMap`/`BTreeSet`s with unequal lengths but equal prefixes, (and also made it so that comparing two different-length `BTreeMap`/`BTreeSet`s with elements whose `PartialEq` impls that can panic now can panic, though this is not a "promised" behaviour either way (cc rust-lang/rust#149122))

Given that `TrustedLen` is an unsafe trait, I opted to not implement it for `BTreeMap`'s iterators, and instead just revert the change. If someone else wants to audit `BTreeMap`'s iterators to make sure they always return the right number of items (even in the face of incorrect user `Ord` impls) and then implement `TrustedLen` for them so that the optimization works for them, then this can be closed in favor of that (or if the perf regression is deemed too theoretical, this can be closed outright).

Example of theoretical perf regression: https://play.rust-lang.org/?version=beta&mode=release&edition=2024&gist=a37e3d61e6bf02669b251315c9a44fe2 (very rough estimates, using `Instant::elapsed`).
In release mode on stable the comparison takes ~23.68µs.
In release mode on beta/nightly the comparison takes ~48.351057ms.
2025-12-02 17:04:58 +00:00
Ayush Singh
1331c35f02
std: sys: fs: uefi: Make time in FileAttr optional
At least on OVMF, some files copied over from linux file system seem
to have invalid time (year = 1980 and everything else 0). Since Rust
allows time to be optional and we can return error, that seems to be
the way to go for now.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-12-02 22:34:47 +05:30
joboet
85b6c380d6
remember the main thread ID before performing platform initialisation 2025-12-02 18:03:33 +01:00
Waffle Lapkin
cb5318d037
stop using "nofallback" revision terminology 2025-12-02 17:46:28 +01:00
Waffle Lapkin
3f606fac00
minor test improvements 2025-12-02 17:46:28 +01:00
Waffle Lapkin
7d33e7e091
clarify purposes of tests 2025-12-02 17:46:24 +01:00
Antoni Boucher
ed64abc14d Update gccjit_sys 2025-12-02 11:39:15 -05:00
Josh Triplett
1ef636d61a Update other targets for BorrowedCursor unstable API changes 2025-12-02 08:03:10 -08:00
James Barford-Evans
79224797fb Regression tests for system register ttbr0_el2 2025-12-02 15:58:06 +00:00
bors
eca9d93f90 Auto merge of #149529 - Muscraft:update-annotate-snippets, r=jieyouxu
chore: Update annotate-snippets to 0.12.10

This PR updates `annotate-snippets` to `0.12.10`, which [includes a fix](756366223c/CHANGELOG.md (fixed)) that modifies some test output.
2025-12-02 13:55:16 +00:00
Waffle Lapkin
e9873435a3
merge diverging-fallback-no-leak into an existing test 2025-12-02 13:41:51 +01:00
Waffle Lapkin
b1efa8e579
stylistic test changes 2025-12-02 13:41:51 +01:00
Waffle Lapkin
0104d69e4b
move tests/ui/{never => never_type}/*
there are only 1 test in that directory, probably created by mistake.
2025-12-02 13:34:51 +01:00
Waffle Lapkin
109b6de8fc
remove outdated tests
I don't think they are testing anything anymore
2025-12-02 13:34:51 +01:00
Waffle Lapkin
8c8d930714
delete a duplicate test
Duplicate of `from_infer_breaking_with_unit_fallback.rs` and
`question_mark_from_never.rs`
2025-12-02 13:34:51 +01:00
Waffle Lapkin
5dec6b3a56
refactor test for note on !: Tr error 2025-12-02 13:34:51 +01:00
The rustc-josh-sync Cronjob Bot
55c229b647 Merge ref '47cd7120d9' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 47cd7120d9
Filtered ref: b5a5cb8beb5c1ac848a39bfcd0ccaad98015d017
Upstream diff: caccb4d036...47cd7120d9

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-02 11:01:27 +00:00
The rustc-josh-sync Cronjob Bot
94a62dc604 Prepare for merging from rust-lang/rust
This updates the rust-version file to 47cd7120d9.
2025-12-02 10:59:26 +00:00
bors
a80d39a086 Auto merge of #149504 - mati865:i686-pc-windows-gnullvm, r=jieyouxu
Bring back i686-pc-windows-gnullvm target

rust-lang/rust#148751 inadvertently removed i686-pc-windows-gnullvm std build when migrating to native CI runners. Since this change was not agreed upon, we should bring back prebuilt std builds for that target.

There are a few runners that could do it: dist-aarch64-llvm-mingw, dist-x86_64-llvm-mingw, dist-various-1 and dist-various-2.
dist-x86_64-llvm-mingw already takes slightly over 2 hours, so the faster dist-aarch64-llvm-mingw is a better choice.
We can also use dist-various-x job, they don't have llvm-mingw toolchain, but it's trivial to install one.
2025-12-02 10:42:35 +00:00
Trevor Gross
93b5361202 ci: Increase the benchmark rustc version to 2025-12-01
Zerocopy (an indirect test dependency) has started requiring
recently-stabilized features, so upgrade our benchmark toolchain to
match.
2025-12-02 05:22:04 -05:00
Waffle Lapkin
98430c4d9d
remove unused features from some tests 2025-12-02 11:07:42 +01:00
Waffle Lapkin
0cbb9e6891
expand never type gate test 2025-12-02 11:07:42 +01:00
Waffle Lapkin
e6d2b2add7
refactor Box<! -> dyn Error> regression test 2025-12-02 11:07:42 +01:00
Waffle Lapkin
3432ff9a1d
remove test for T -> ! coercion
We used to allow `T -> !` coercions (yes!! not `! -> T`) in unreachable
code. This was later removed during 2018 stabilization attempt, see:
- https://github.com/rust-lang/rust/issues/40800
- https://github.com/rust-lang/rust/pull/47630/commits/59688e119e1b9c2506fa9173728ae88eb196bf5e
- https://github.com/rust-lang/rust/issues/46325

I've kept `tests/ui/coercion/coerce-to-bang-cast.rs`, as that is a
reasonable test for us *not* having `-> !` coercions.
2025-12-02 11:07:42 +01:00
Waffle Lapkin
140832aa59
update readme wrt never type tests 2025-12-02 11:07:42 +01:00
Josh Triplett
382509988b Remove initialized-bytes tracking from BorrowedBuf and BorrowedCursor
As discussed extensively in libs-api, the initialized-bytes tracking
primarily benefits calls to `read_buf` that end up initializing the
buffer and calling `read`, at the expense of calls to `read_buf` that
*don't* need to initialize the buffer. Essentially, this optimizes for
the past at the expense of the future. If people observe performance
issues using `read_buf` (or something that calls it) with a given `Read`
impl, they can fix those performance issues by implementing `read_buf`
for that `Read`.

Update the documentation to stop talking about initialized-but-unfilled
bytes.

Remove all functions that just deal with those bytes and their tracking,
and remove usage of those methods.

Remove `BorrowedCursor::advance` as there's no longer a safe case for
advancing within initialized-but-unfilled bytes. Rename
`BorrowedCursor::advance_unchecked` to `advance`.

Update tests.
2025-12-02 01:32:27 -08:00
Laurențiu Nicola
aa0176a9ed
Merge pull request #21189 from Wilfred/mdbook_toc_simplify
internal: Remove mdbook-toc usage
2025-12-02 07:57:01 +00:00
bors
47cd7120d9 Auto merge of #147634 - fmease:mv-var-to-dyn-buf-lints-next, r=jdonszelmann
Move even more early buffered lints to dyn lint diagnostics

Follow-up to https://github.com/rust-lang/rust/pull/145881 and https://github.com/rust-lang/rust/pull/145747.

I originally wanted to migrate most if not the entire rest of the early buffered lints. However, when trying to migrate the buffered lints used by check-cfg I encountered a roadblock. Namely, it depends on `TyCtxt` (well, `Option<TyCtxt>`) which makes it quite hard to migrate (see also https://github.com/rust-lang/rust/pull/147634#issuecomment-3398174584, https://github.com/rust-lang/rust/pull/147634#issuecomment-3398207128 & rust-lang/rust#149215).

So for now, I won't migrate it (maybe rust-lang/rust#149215 will find a solution), nor will I migrate the rest since it's quite tedious to migrate these. I'll leave them for future me.
2025-12-02 07:33:36 +00:00
Laurențiu Nicola
56431c4da3
Merge pull request #21191 from chuck-sys/fix/spelling
fix(spelling): underling -> underlying
2025-12-02 07:32:29 +00:00
Cheuk Yin Ng
1099da1877
fix(spelling): underling -> underlying 2025-12-01 23:21:18 -08:00
quaternic
3f1aa0b47e Additional test for uN::{gather,scatter}_bits 2025-12-02 09:20:47 +02:00
bors
63b1db0580 Auto merge of #149531 - Zalathar:rollup-15y580s, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#145628 ([std][BTree] Fix behavior of `::append` to match documentation, `::insert`, and `::extend`)
 - rust-lang/rust#149241 (Fix armv4t- and armv5te- bare metal targets)
 - rust-lang/rust#149470 (compiletest: Prepare ignore/only conditions once in advance, without a macro)
 - rust-lang/rust#149507 (Mark windows-gnu* as lacking build with assertions)
 - rust-lang/rust#149508 (Prefer helper functions to identify MinGW targets)
 - rust-lang/rust#149516 (Stop adding MSYS2 to PATH)
 - rust-lang/rust#149525 (debuginfo/macro-stepping test: extend comments)
 - rust-lang/rust#149526 (Add myself (mati865) to the review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-02 04:23:39 +00:00
Stuart Cook
e168509186
Rollup merge of #149526 - mati865:mati865-review-rotation, r=Kivooeo
Add myself (mati865) to the review rotation

I've been procrastinating long enough.
2025-12-02 13:56:33 +11:00
Stuart Cook
cd6c17ea89
Rollup merge of #149525 - RalfJung:debuginfo-test-comments, r=jieyouxu
debuginfo/macro-stepping test: extend comments

Those `#locN` markers look like they are debuginfo compiletest magic (since `#break` is debuginfo compiletest magic). However, they are actually just magic strings used by the `check` commands in the test itself. This threw me off when I looked at the test (prompted by a CI failure), so let's leave a comment for the next poor soul that ends up lost in this test.

Also, for some reason the lldb instructions do not check for `#loc6`, unlike the gdb instructions. I do not know of an lldb version that actually makes the test pass (do we even run it with lldb at all on CI?), so I won't try to add a check for loc6, but let's at least add a comment to increase the chance that someone more knowledgeable about lldb and our test suite notices this in the future.
2025-12-02 13:56:32 +11:00
Stuart Cook
5afd8ff8df
Rollup merge of #149516 - mati865:no-msys2, r=jieyouxu
Stop adding MSYS2 to PATH

Rust no longer requires MSYS2 provided tools like make.
2025-12-02 13:56:32 +11:00
Stuart Cook
7cb02f9752
Rollup merge of #149508 - mati865:mingw-helpers, r=jieyouxu
Prefer helper functions to identify MinGW targets
2025-12-02 13:56:31 +11:00
Stuart Cook
7437db72a8
Rollup merge of #149507 - mati865:windows-gnu-like-no-asserts, r=clubby789
Mark windows-gnu* as lacking build with assertions

Knowing that `x86_64-pc-windows-gnu` has no builds with assertions, I have just copied it as `x86_64-pc-windows-gnullvm` and called a day. Obviously it should have been `false`, sorry for that.
While at it, also fix `x86_64-pc-windows-gnu`.
2025-12-02 13:56:31 +11:00
Stuart Cook
bbde1c0825
Rollup merge of #149470 - Zalathar:prepared-conditions, r=jieyouxu
compiletest: Prepare ignore/only conditions once in advance, without a macro

Compiletest has historically handled `ignore-*` and `only-*` directives in an extremely confusing way that makes the code hard to understand and hard to modify.

This PR therefore takes an important step away from that older design by instead evaluating a set of named boolean "conditions" in advance, and then using those conditions to help determine whether a particular directive should cause its test to be ignored or not.

As usual, there's more cleanup that I want to do here, but I've left most of it for future work to help keep this PR manageable.

r? jieyouxu
2025-12-02 13:56:30 +11:00
Stuart Cook
c539f3ffe1
Rollup merge of #149241 - thejpster:fix-armv4t-armv5te-bare-metal, r=davidtwco
Fix armv4t- and armv5te- bare metal targets

These two targets currently force on the LLVM feature `+atomics-32`. LLVM doesn't appear to actually be able to emit 32-bit load/store atomics for these targets despite this feature, and emits calls to a shim function called `__sync_lock_test_and_set_4`, which nothing in the Rust standard library supplies.

See [#t-compiler/arm > __sync_lock_test_and_set_4 on Armv5TE](https://rust-lang.zulipchat.com/#narrow/channel/242906-t-compiler.2Farm/topic/__sync_lock_test_and_set_4.20on.20Armv5TE/with/553724827) for more details.

Experimenting with clang and gcc (as logged in that zulip thread) shows that C code cannot do atomic load/stores on that architecture either (at least, not without a library call inserted).

So, the safest thing to do is probably turn off `+atomics-32` for these two Tier 3 targets.

I asked `@Lokathor` and he said he didn't even use atomics on the `armv4t-none-eabi`/`thumbv4t-none-eabi` target he maintains.

I was unable to reach `@QuinnPainter` for comment for `armv5te-none-eabi`/`thumbv5te-none-eabi`.

The second commit renames the base target spec `spec::base::thumb` to `spec::base::arm_none` and changes `armv4t-none-eabi`/`thumbv4t-none-eabi` and `armv5te-none-eabi`/`thumbv5te-none-eabi` to use it. This harmonises the frame-pointer and linker options across the bare-metal Arm EABI and EABIHF targets.

You could make an argument for harmonising `armv7a-none-*`, `armv7r-none*` and `armv8r-none-*` as well, but that can be another PR.
2025-12-02 13:56:30 +11:00
Stuart Cook
dbb92adfc1
Rollup merge of #145628 - tinnamchoi:fix-btree-append, r=Amanieu
[std][BTree] Fix behavior of `::append` to match documentation, `::insert`, and `::extend`

Resolves rust-lang/rust#145614
2025-12-02 13:56:29 +11:00
Chayim Refael Friedman
bff5839a49
Merge pull request #21182 from ChayimFriedman2/param-env
internal: Remove `TraitEnvironment`
2025-12-02 02:53:34 +00:00
reddevilmidzy
073f5e29f1 Updated tests/ui/for-loop-while/iter-from-mac-call.rs 2025-12-02 11:25:36 +09:00
reddevilmidzy
416ae00e31 cleaned up some tests 2025-12-02 11:24:03 +09:00
reddevilmidzy
ab9d0e0ab6 moved tests
updated `tests/ui/README.md`and `src/tools/tidy/src/issues.txt`
2025-12-02 11:13:37 +09:00
Scott Schafer
b2b059c20b
chore: Update annotate-snippets to 0.12.10 2025-12-01 18:12:35 -07:00
bors
4ad239f415 Auto merge of #142821 - cjgillot:jump-threading-single, r=saethlin
Compute jump threading opportunities in a single pass

The current implementation of jump threading walks MIR CFG backwards from each `SwitchInt` terminator. This PR replaces this by a single postorder traversal of MIR. In theory, we could do a full fixpoint dataflow analysis, but this has low returns as we forbid threading through a loop header.

The second commit in this PR modifies the carried state to a lighter data structure. The current implementation uses some kind of `IndexVec<ValueIndex, &[Condition]>`. This is needlessly heavy, as the state rarely ever carries more than a few `Condition`s. The first commit replaces this state with a simpler `&[Condition]`, and puts the corresponding `ValueIndex` inside `Condition`.

The three later commits are perf tweaks.

The sixth commit is the main change. Instead of carrying the goto target inside the condition, we maintain a set of conditions associated with each block, and their consequences in following blocks. Think: if this condition is fulfilled in this block, then that condition is fulfilled in that block. This makes the threading algorithm much easier to implement, without the extra bookkeeping of `ThreadingOpportunity` we had.

Later commits modify that algorithm to shrink the set of duplicated blocks. By propagating fulfilled conditions down the CFG, and trimming costly threads.
2025-12-01 23:44:49 +00:00
Mateusz Mikuła
5c282908be
Add myself (mati865) to the review rotation
I've been procrastinating long enough.
2025-12-01 22:46:13 +01:00
Ralf Jung
18af84b138 debuginfo/macro-stepping test: extend comments 2025-12-01 22:32:36 +01:00
bors
1d60f9e070 Auto merge of #149515 - matthiaskrgr:rollup-djmciuc, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#149393 (expand valid edition range for use-path-segment-kw.rs)
 - rust-lang/rust#149427 (Make the capitalization explicit on keyword misspell error)
 - rust-lang/rust#149433 (Use a delayed bug for this layout ICE)
 - rust-lang/rust#149473 (Tidying up UI tests [7/N])
 - rust-lang/rust#149505 (Update the comment in the add_typo_suggestion function)
 - rust-lang/rust#149513 (`rust-analyzer` subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-01 20:29:33 +00:00
Santiago Pastorino
d60f7800ef
This statement is misleading 2025-12-01 17:08:19 -03:00