Commit graph

309635 commits

Author SHA1 Message Date
Jacob Pratt
47eeb00a63
Rollup merge of #145992 - GrigorenkoPV:stabilize/vec_deque_pop_if, r=Amanieu
Stabilize `vec_deque_pop_if`

Tracking issue: rust-lang/rust#135889
Closes rust-lang/rust#135889
Also fixes a typo mentioned in https://github.com/rust-lang/rust/issues/135889#issuecomment-2991213248

FCP: https://github.com/rust-lang/rust/issues/135889#issuecomment-3238777731

`@rustbot` label -T-libs +T-libs-api +needs-fcp +S-waiting-on-fcp

r? t-libs-api
2025-11-07 00:21:17 -05:00
Jacob Pratt
c63793952e
Rollup merge of #145768 - ZuseZ4:offload-device, r=oli-obk
Offload device

LLVM's offload functionality usually expects an extra dyn_ptr argument. We could avoid it,b ut likely gonna need it very soon in one of the follow-up PRs (e.g. to request shared memory). So we might as well already add it.

This PR adds a %dyn_ptr ptr to GPUKernel ABI functions, if the offload feature is enabled.

WIP

r? ```@ghost```
2025-11-07 00:21:17 -05:00
bors
c90bcb9571 Auto merge of #148573 - matthiaskrgr:rollup-cn5viia, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#146861 (add extend_front to VecDeque with specialization like extend)
 - rust-lang/rust#148213 (Fix invalid tag closing when leaving expansion "original code")
 - rust-lang/rust#148292 (Un-shadow object bound candidate in `NormalizesTo` goal if self_ty is trait object)
 - rust-lang/rust#148528 (run-make tests: use edition 2024)
 - rust-lang/rust#148554 (Add regression test for issue 148542)
 - rust-lang/rust#148561 (Fix ICE from async closure variance)
 - rust-lang/rust#148563 (rustdoc-search: remove broken index special case)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-06 14:52:37 +00:00
bors
c5e283b0d2 Auto merge of #148188 - Muscraft:annotate-snippets-default-on-nightly, r=estebank
feat: Use annotate-snippets by default on nightly

This PR switches the default renderer to use `annotate-snippets` on nightly, but does not affect stable. This is part of the ongoing effort to use `annotate-snippets` to render all diagnostics.

[MCP](https://github.com/rust-lang/compiler-team/issues/937)

Note: This contains the test change from rust-lang/rust#148004, without the change to the default emitter.

rust-lang/rust#59346
rust-lang/rust-project-goals#123

r? `@davidtwco`
2025-11-06 11:45:06 +00:00
Matthias Krüger
1a6770c5c4
Rollup merge of #148563 - notriddle:index-typedata-bug, r=GuillaumeGomez
rustdoc-search: remove broken index special case

Fixes https://github.com/rust-lang/rust/issues/148431
2025-11-06 12:30:01 +01:00
Matthias Krüger
76dae76146
Rollup merge of #148561 - chenyukang:yukang-fix-148488, r=lqd
Fix ICE from async closure variance

Fixes rust-lang/rust#148488

The fix is also a change from rust-lang/rust#148556
2025-11-06 12:30:00 +01:00
Matthias Krüger
a3409fde47
Rollup merge of #148554 - chenyukang:test-issue-148542, r=jieyouxu
Add regression test for issue 148542

Closes rust-lang/rust#148542
2025-11-06 12:30:00 +01:00
Matthias Krüger
320af6b789
Rollup merge of #148528 - hkBst:run-make-tests-1, r=jieyouxu
run-make tests: use edition 2024

Bump run-make tests to edition 2024 to prevent test failures when using 2024 idioms in included code, such as I ran into here: https://github.com/rust-lang/rust/pull/147808.
2025-11-06 12:29:59 +01:00
Matthias Krüger
fc318986f3
Rollup merge of #148292 - adwinwhite:assemble_object_candidate, r=lcnr
Un-shadow object bound candidate in `NormalizesTo` goal if self_ty is trait object

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/244

r? lcnr
2025-11-06 12:29:58 +01:00
Matthias Krüger
7b766e026a
Rollup merge of #148213 - GuillaumeGomez:fix-exit-of-expansion, r=yotamofek
Fix invalid tag closing when leaving expansion "original code"

Fixes rust-lang/rust#148184.

Problem was that in case an element inside the expansion's "original" element was not closed, this element would get its `pending_exit` field set to `true`, removing it when the next non-mergeable item gets pushed instead of being put inside it, and then next `exit_elem` would try to exit an empty class queue.

r? ```@notriddle```
2025-11-06 12:29:58 +01:00
Matthias Krüger
f7f128fd48
Rollup merge of #146861 - antonilol:vec_deque_extend_front, r=joboet
add extend_front to VecDeque with specialization like extend

ACP: https://github.com/rust-lang/libs-team/issues/658
Tracking issue: rust-lang/rust#146975

_Text below was written before opening the ACP_

Feature was requested in rust-lang/rust#69939, I recently also needed it so decided to implement it as my first contribution to the Rust standard library. I plan on doing more but wanted to start with a small change.

Some questions I had (both on implementation and design) with answers:
- Q: `extend` allows iterators that yield `&T` where `T` is `Clone`, should extend_front do too?
  A: No, users can use [`copied`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.copied) and/or [`cloned`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.cloned).
- Q: Does this need a whole new trait like Extend or only a method on `VecDeque`?
  A: No, see ACP.
- Q: How do I deal with all the code duplication? Most code is similar to that of `extend`, maybe there is a nice way to factor out the code around `push_unchecked`/`push_front_unchecked`.
  Will come back to this later.
- Q: Why are certain things behind feature gates, `cfg(not(test))` like `vec::IntoIter` here and `cfg(not(no_global_oom_handling))` like `Vec::extend_from_within`? (I am also looking at implementing `VecDeque::extend_from_within`)
  A: See https://github.com/rust-lang/rust/pull/146861#pullrequestreview-3250163369
- Q: Should `extend_front` act like repeated pushes to the front of the queue? This reverses the order of the elements. Doing it different might incur an extra move if the iterator length is not known up front (where do you start placing elements in the buffer?).
  A: `extend_front` acts like repeated pushes, `prepend` preserves the element order, see ACP or tracking issue.
2025-11-06 12:29:57 +01:00
bors
642c19bfc3 Auto merge of #148560 - Zalathar:rollup-c62przo, r=Zalathar
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#143037 (Make named asm_labels lint not trigger on hexagon register spans)
 - rust-lang/rust#147043 (Add default sanitizers to TargetOptions)
 - rust-lang/rust#147586 (std-detect: improve detect macro docs)
 - rust-lang/rust#147912 ([rustdoc] Gracefully handle error in case we cannot run the compiler in doctests)
 - rust-lang/rust#148540 (Minor fixes to StdNonZeroNumberProvider for gdb)
 - rust-lang/rust#148541 (Add num_children method to some gdb pretty-printers)
 - rust-lang/rust#148549 (Fix broken qemu-cskyv2 link)

Failed merges:

 - rust-lang/rust#147935 (Add LLVM realtime sanitizer)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-06 08:39:07 +00:00
Manuel Drehwald
360b38cceb Fix device code generation, to account for an implicit dyn_ptr argument. 2025-11-06 03:34:38 -05:00
Michael Howell
c8b2a9af2b rustdoc-search: remove broken index special case 2025-11-05 23:41:43 -07:00
yukang
a9795db068 Fix ICE from async closure variance 2025-11-06 11:18:38 +08:00
Stuart Cook
7c58e15300
Rollup merge of #148549 - ehuss:fix-csky-link, r=Kivooeo
Fix broken qemu-cskyv2 link

The link had a stray character that generated an invalid link.
2025-11-06 14:07:19 +11:00
Stuart Cook
8e7417ceb2
Rollup merge of #148541 - tromey:add-num-children, r=bjorn3
Add num_children method to some gdb pretty-printers

gdb doesn't have a way to know when an object hasn't yet been initialized, and in this case, if a pretty-printer returns an absurd number of children, this can result in apparent hangs in some modes. This came up specifically with DAP, see this bug report:

    https://sourceware.org/bugzilla/show_bug.cgi?id=33594

This patch (mostly) addresses this potential issue in the Rust pretty-printers, by adding 'num_children' methods.  In particular a method like this is added when the number of children is variable and also relatively easy to compute.  (I.e., I didn't attempt the btree printers.)

Supplying num_children is good for DAP regardless of the initialization problem, because DAP requires a count of child objects and this is more efficient than enumerating the children, which is gdb's fallback approach.
2025-11-06 14:07:18 +11:00
Stuart Cook
2d77f23f0b
Rollup merge of #148540 - tromey:non-zero-gdb-cleanup, r=bjorn3
Minor fixes to StdNonZeroNumberProvider for gdb

While looking at the pretty-printers, I found a few minor oddities in StdNonZeroNumberProvider.

First, gdb.Type.fields() already returns a sequence, so there's no need to call list().

Second, it's more idiomatic for the (somewhat misnamed) to_string method to simply return the underlying gdb.Value.  This also lets gdb apply whatever formats were passed to `print`, as the new test shows.

Third, there's no need to use the field's name when looking up a field in a value, the gdb.Field itself can be used.
2025-11-06 14:07:18 +11:00
Stuart Cook
dd803610f0
Rollup merge of #147912 - GuillaumeGomez:graceful-doctest-error-handling, r=lolbinarycat
[rustdoc] Gracefully handle error in case we cannot run the compiler in doctests

Fixes bug reported in [this comment](https://github.com/rust-lang/rust/issues/102981#issuecomment-3407855923).

r? ``@lolbinarycat``
2025-11-06 14:07:17 +11:00
Stuart Cook
c9ca719218
Rollup merge of #147586 - folkertdev:std-detect-expands-to-true, r=Amanieu
std-detect: improve detect macro docs

Specifically, document that the detect macros expand to `true` when the feature is statically enabled.

Now that we have a bunch of these macros, perhaps we should streamline further how they are documented?

r? ``@Amanieu``
2025-11-06 14:07:16 +11:00
Stuart Cook
efdc8aca3e
Rollup merge of #147043 - ilovepi:default-sanitizers, r=petrochenkov
Add default sanitizers to TargetOptions

Some sanitizers are part of a system's ABI, like the shadow call stack on Aarch64 and RISC-V Fuchsia. Typically ABI options have other spellings, but LLVM has, for historical reasons, marked this as a sanitizer instead of an alternate ABI option. As a result, Fuchsia targets may not be compiled against the correct ABI unless this option is set. This hasn't caused correctness problems, since the backend reserves the SCS register, and thus preserves its value. But this is an issue for unwinding, as the SCS will not be an array of PCs describing the call complete call chain, and will have gaps from callers that don't use the correct ABI.

In the long term, I'd like to see all the sanitizer configs that all frontends copy from clang moved into llvm's libFrontend, and exposed so that frontend consumers can use a small set of simple APIs to use sanitizers in a consistent way across the LLVM ecosystem, but that work is not yet ready today.
2025-11-06 14:07:16 +11:00
Stuart Cook
12deb2f513
Rollup merge of #143037 - androm3da:bcain/hexagon_regspan_label, r=Amanieu
Make named asm_labels lint not trigger on hexagon register spans

Fixes https://github.com/rust-lang/rust/issues/143021
2025-11-06 14:07:15 +11:00
Brian Cain
54df8dae29 CI fixes after recent rebase changes 2025-11-05 19:43:29 -06:00
yukang
55b0125d16 Add regression test for ice 2025-11-06 09:41:16 +08:00
Eric Huss
0717a3929f Fix broken qemu-cskyv2 link
The link had a stray character that generated an invalid link.
2025-11-05 14:37:38 -08:00
Brian Cain
71e599b91a Make named asm_labels lint not trigger on hexagon register spans 2025-11-05 16:24:30 -06:00
Guillaume Gomez
2c3c82c4c5 Add new run_make_support::CompletedProcess::assert_ice method 2025-11-05 22:43:25 +01:00
bors
401ae55427 Auto merge of #148544 - matthiaskrgr:rollup-n9dqgwc, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#147994 (Deduplicate deprecation warning when using unit or tuple structs)
 - rust-lang/rust#148440 ([rustdoc search] Simplify itemTypes and filter "dependencies")
 - rust-lang/rust#148501 (triagebot: Create Zulip topics for libs backports)
 - rust-lang/rust#148517 (Remove no longer necessary lint allow)
 - rust-lang/rust#148518 (Unify the configuration of the compiler docs)
 - rust-lang/rust#148523 (miri subtree update)
 - rust-lang/rust#148525 (Fix ICE from lit_to_mir_constant caused by type error)
 - rust-lang/rust#148534 (Merge `Vec::push{,_mut}_within_capacity`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-05 21:07:24 +00:00
Matthias Krüger
05f3a3d7f5
Rollup merge of #148534 - WaffleLapkin:push_within_capacity_now_with_50_percent_more_mut, r=Amanieu
Merge `Vec::push{,_mut}_within_capacity`

Implements https://github.com/rust-lang/libs-team/issues/689.

cc https://github.com/rust-lang/rust/issues/135974, https://github.com/rust-lang/rust/issues/100486

r? libs-api
2025-11-05 21:28:31 +01:00
Matthias Krüger
72cef11570
Rollup merge of #148525 - chenyukang:yukang-fix-148515, r=wesleywiser
Fix ICE from lit_to_mir_constant caused by type error

Fixes rust-lang/rust#148515

we still need to mark that there were errors to prevent later phases (like MIR building) from proceeding.
2025-11-05 21:28:31 +01:00
Matthias Krüger
5ed4fafff2
Rollup merge of #148523 - RalfJung:miri, r=RalfJung
miri subtree update

x86/rounding-error is causing spurious test failures. This sync fixes that.

---

Subtree update of `miri` to de2a63b1e2.

Created using https://github.com/rust-lang/josh-sync.

r? ``@ghost``
2025-11-05 21:28:30 +01:00
Matthias Krüger
958f2a911f
Rollup merge of #148518 - bjorn3:unify_compiler_doc_config, r=GuillaumeGomez
Unify the configuration of the compiler docs

Previously it was rather inconsistent which crates got the rust logo and which didn't and setting html_root_url was forgotten in many cases.
2025-11-05 21:28:29 +01:00
Matthias Krüger
d195074363
Rollup merge of #148517 - bjorn3:lint_cleanup, r=joboet
Remove no longer necessary lint allow
2025-11-05 21:28:29 +01:00
Matthias Krüger
5f3b18638e
Rollup merge of #148501 - tgross35:triagebot-libs-backports, r=Amanieu
triagebot: Create Zulip topics for libs backports

Take the configuration used by other teams to create Zulip topics for T-libs backports.
2025-11-05 21:28:28 +01:00
Matthias Krüger
54fa49846f
Rollup merge of #148440 - GuillaumeGomez:improve-search-code, r=notriddle
[rustdoc search] Simplify itemTypes and filter "dependencies"

We currently have a list of type filters, some constants to be able to index the list of type filters and finally a `switch` to include some types in a given filter (for example when we filter on `constant`, we also include `associatedconstant` items).

r? ``@notriddle``
2025-11-05 21:28:27 +01:00
Matthias Krüger
a508f6136a
Rollup merge of #147994 - jdonszelmann:duplicate-warning-struct, r=petrochenkov
Deduplicate deprecation warning when using unit or tuple structs

First commit adds a test that's broken currently, 2nd commit fixes it.

Created with `@WaffleLapkin`
2025-11-05 21:28:27 +01:00
Tom Tromey
d2b021c340 Add num_children method to some gdb pretty-printers
gdb doesn't have a way to know when an object hasn't yet been
initialized, and in this case, if a pretty-printer returns an absurd
number of children, this can result in apparent hangs in some modes.
This came up specifically with DAP, see this bug report:

    https://sourceware.org/bugzilla/show_bug.cgi?id=33594

This patch (mostly) addresses this potential issue in the Rust
pretty-printers, by adding 'num_children' methods.  In particular a
method like this is added when the number of children is variable and
also relatively easy to compute.  (I.e., I didn't attempt the btree
printers.)

Supplying num_children is good for DAP regardless of the
initialization problem, because DAP requires a count of child objects
and this is more efficient than enumerating the children, which is
gdb's fallback approach.
2025-11-05 11:51:25 -07:00
Tom Tromey
71e2e0cded Minor fixes to StdNonZeroNumberProvider for gdb
While looking at the pretty-printers, I found a few minor oddities in
StdNonZeroNumberProvider.

First, gdb.Type.fields() already returns a sequence, so there's no
need to call list().

Second, it's more idiomatic for the (somewhat misnamed) to_string
method to simply return the underlying gdb.Value.  This also lets gdb
apply whatever formats were passed to `print`, as the new test shows.

Third, there's no need to use the field's name when looking up a field
in a value, the gdb.Field itself can be used.
2025-11-05 11:42:54 -07:00
bors
b01cc1cf01 Auto merge of #148516 - bjorn3:target_feature_parsing_improvements, r=WaffleLapkin
Move warning reporting from flag_to_backend_features to cfg_target_feature

This way warnings are emitted even in a check build.
2025-11-05 17:56:16 +00:00
Waffle Lapkin
32c93ccc89
Merge Vec::push{,_mut}_within_capacity 2025-11-05 17:03:25 +01:00
Scott Schafer
9243928c6c
feat: Use annotate-snippets by default on nightly 2025-11-05 09:01:07 -07:00
Scott Schafer
9cb7deb0b5
refactor: Make short a field on HumanReadableErrorType varinants 2025-11-05 09:01:07 -07:00
Scott Schafer
4748d92a95
feat: Always use annotate-snippets for Unicode output 2025-11-05 09:01:07 -07:00
Scott Schafer
a75bd03fb9
fix: Respect HumanReadableErrorType::AnnotateSnippet 2025-11-05 09:01:07 -07:00
Scott Schafer
37bb0c262a
chore: Make AnnotateSnippetEmitter match revert of "all spans must be disjoint" 2025-11-05 09:01:07 -07:00
Scott Schafer
457cbb06a1
chore: Update annotate-snippets to 0.12.8 2025-11-05 09:00:58 -07:00
Marijn Schouten
fd6466aea7 run-make tests: use edition 2024 2025-11-05 14:28:16 +00:00
bors
1ef7943ee6 Auto merge of #148302 - folkertdev:non-rustic-unsized, r=bjorn3
error on non-rustic ABIs using unsized parameters

tracking issue: https://github.com/rust-lang/rust/issues/48055

This came up in https://github.com/rust-lang/rust/pull/144529#discussion_r2470214068.

The idea is that the layout of an unsized type is unstable (following the rust layout rules), and hence stable ABIs should not use unsized types. On stable, unsized types (or generics with a `?Sized` bound) are not accepted as parameters, so the errors introduced by this PR can only be observed when the unstable `unsized_fn_params` feature is enabled.

r? `@bjorn3`
cc `@RalfJung`
2025-11-05 14:07:06 +00:00
Adwin White
d2cfc47ed0 add test for alias self_ty 2025-11-05 21:29:39 +08:00
yukang
eaf979e8dd Fix ICE from lit_to_mir_constant caused by type error 2025-11-05 20:26:43 +08:00