Commit Graph

309613 Commits

Author SHA1 Message Date
Ralf Jung b032fac34e stabilize duration_from_nanos_u128 2025-11-06 18:08:29 +01: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
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
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
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 https://github.com/rust-lang/miri/commit/de2a63b1e2df549087b33d0da10b3027537d6a07.

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
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
yukang eaf979e8dd Fix ICE from lit_to_mir_constant caused by type error 2025-11-05 20:26:43 +08:00
bjorn3 222480dcb9 Allow internal_features lint in doc tests
Rustdoc forwards -Zcrate-attr=feature(rustdoc_internals) to doc tests,
but deny(warnings) overrides the -Ainternal_features.
2025-11-05 11:25:29 +00:00
bjorn3 973c7527b4 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 11:25:27 +00:00
Folkert de Vries 8e44e3f6a9 error on non-rustic ABIs using unsized parameters 2025-11-05 12:12:10 +01:00
bors 53efb3d4f3 Auto merge of #148492 - pmur:murp/ppc-relax-r29-inlineasm, r=Amanieu
Relax r29 inline asm restriction on PowerPC64 targets

LLVM uses r29 to hold a base pointer for some PowerPC target configurations. It is usable on all 64 bit targets as a callee save register.

r? `@Amanieu`
2025-11-05 10:55:49 +00:00
bjorn3 1d34478147 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 10:48:29 +00:00
Guillaume Gomez 72d94d10df [rustdoc search] Simplify itemTypes and filter "dependencies" 2025-11-05 11:45:36 +01:00
bors 8e0b68e63c Auto merge of #148507 - Zalathar:rollup-vvz4knr, r=Zalathar
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#147355 (Add alignment parameter to `simd_masked_{load,store}`)
 - rust-lang/rust#147925 (Fix tests for big-endian)
 - rust-lang/rust#148341 (compiler: Fix a couple issues around cargo feature unification)
 - rust-lang/rust#148371 (Dogfood `trim_{suffix|prefix}` in compiler)
 - rust-lang/rust#148495 (Implement Path::is_empty)
 - rust-lang/rust#148502 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-05 07:25:39 +00:00
bors c0ff72ffc4 Auto merge of #147645 - tamird:arch-enum, r=nnethercote
rustc_target: introduce Arch

Improve type safety by using an enum rather than strings.
2025-11-05 04:15:09 +00:00
Tamir Duberstein 26b0560b6d rustc_target: allow unenumerated architectures 2025-11-04 21:28:28 -05:00
Tamir Duberstein 0c8533d690 compiler: intern architecture at compile time 2025-11-04 21:27:23 -05:00
Tamir Duberstein 270e49b307 rustc_target: introduce Arch
Improve type safety by using an enum rather than strings.
2025-11-04 21:27:22 -05:00
Tamir Duberstein cf053b3774 rustc_target::spec::base:🍎 nix use Arch::*
This will reduce ambiguity with `rustc_target::spec::Arch`.
2025-11-04 21:20:22 -05:00
Tamir Duberstein 5e73e6593f rename rustc_target::spec::abi_map::Arch{,Kind}
This makes way for `rustc_target::spec::Arch`.
2025-11-04 21:20:21 -05:00
Stuart Cook 41382a4bf0 Rollup merge of #148502 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/1a96e5eb174d217df823c35a251e87e082cff4bf.

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

r? `@ghost`
2025-11-05 10:59:21 +11:00
Stuart Cook 6e03719029 Rollup merge of #148495 - ChrisDenton:path_is_empty, r=workingjubilee
Implement Path::is_empty

This implements `Path::is_empty` which is simply a convenience wrapper for `path.as_os_str().is_empty()`.

Tracking issue: https://github.com/rust-lang/rust/issues/148494
ACP: https://github.com/rust-lang/libs-team/issues/687
2025-11-05 10:59:20 +11:00