Commit Graph

315063 Commits

Author SHA1 Message Date
rust-bors[bot] 85d0cdfe34 Auto merge of #150265 - scottmcm:vec-less-ubchecks, r=jhpratt
Stop emitting UbChecks on every Vec→Slice

Spotted this in rust-lang/rust#148766's test changes.  It doesn't seem like this ubcheck would catch anything useful; let's see if skipping it helps perf.  (After all, this is inside *every* `[]` on a vec, among other things.)
2026-01-09 09:04:56 +00:00
Scott McMurray c48df5dcf1 Move the rustc_no_mir_inline down a level 2026-01-08 17:14:02 -08:00
Scott McMurray 5932078c79 Stop emitting UbChecks on every Vec→Slice
Spotted this in PR148766's test changes.  It doesn't seem like this ubcheck would catch anything useful; let's see if skipping it helps perf.
2026-01-08 17:14:02 -08:00
rust-bors[bot] 3fda0e426c Auto merge of #150839 - matthiaskrgr:rollup-3a0ebXJ, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#149961 (tidy: add if-installed prefix condition to extra checks system)
 - rust-lang/rust#150475 (std: sys: fs: uefi: Implement initial File)
 - rust-lang/rust#150533 (std: sys: fs: uefi: Implement remove_dir_all)
 - rust-lang/rust#150549 (fix missing_panics_doc in `std::os::fd::owned`)
 - rust-lang/rust#150699 (MGCA: Support literals as direct const arguments)
 - rust-lang/rust#150721 (Deprecated doc intra link)
 - rust-lang/rust#150802 (Minor cleanups to fn_abi_new_uncached)
 - rust-lang/rust#150803 (compiler-builtins subtree update)
 - rust-lang/rust#150809 (Update `literal-escaper` version to `0.0.7`)
 - rust-lang/rust#150811 (Store defids instead of symbol names in the aliases list)
 - rust-lang/rust#150825 (Query associated_item_def_ids when needed)

r? @ghost
2026-01-08 23:40:03 +00:00
Matthias Krüger 0fbcfb9a05 Rollup merge of #150825 - move-items, r=JonathanBrouwer
Query associated_item_def_ids when needed

This commit moves a query to `associated_item_defs` from above an error condition caused independently of it to below it.

It looks generally cleaner and might potentially save some runtime in case the error condition is met, rendering `items` to be left unused, yet still queried.
2026-01-08 22:21:21 +01:00
Matthias Krüger d464630301 Rollup merge of #150811 - defid-aliases, r=bjorn3
Store defids instead of symbol names in the aliases list

I was honestly surprised this worked in the past. This causes a cycle error since we now compute a symbol name in codegen_attrs, and then compute codegen attrs when we try to get the symbol name.

It only worked when there weren't any codegen attributes to begin with, causing symbol name computation to skip the call to codegen_attrs.

Like this we won't have the same problem.

r? @bjorn3
2026-01-08 22:21:21 +01:00
Matthias Krüger 74ab9a4784 Rollup merge of #150809 - update-literal-escaper, r=Urgau
Update `literal-escaper` version to `0.0.7`

It removes the `std` dependency for this crate (which doesn't change anything for rustc 😄 ).

cc @bjorn3
r? @Urgau
2026-01-08 22:21:21 +01:00
Matthias Krüger d1aaf26d83 Rollup merge of #150803 - update-builtins, r=tgross35
compiler-builtins subtree update

Subtree update of `compiler-builtins` to https://github.com/rust-lang/compiler-builtins/commit/65624df7f55db9b7b494fbe3aa9dcea0a743eea4.

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

r? @ghost
2026-01-08 22:21:20 +01:00
Matthias Krüger 36d0f35d3d Rollup merge of #150802 - fn_abi_cleanup, r=lqd
Minor cleanups to fn_abi_new_uncached
2026-01-08 22:21:19 +01:00
Matthias Krüger d763ffaf04 Rollup merge of #150721 - deprecated-doc-intra-link, r=GuillaumeGomez
Deprecated doc intra link

fixes https://github.com/rust-lang/rust/issues/98342
r? @GuillaumeGomez

Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g.

```rust
#[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")]
```

renders as

<img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
2026-01-08 22:21:19 +01:00
Matthias Krüger cb3b2d8655 Rollup merge of #150699 - literals-as-direct-const-args, r=BoxyUwU
MGCA: Support literals as direct const arguments

Fixes [#150168](https://github.com/rust-lang/rust/issues/150618)

- **initial changes for mcga literals**
- **rustfmt**

r? @BoxyUwU
2026-01-08 22:21:17 +01:00
Matthias Krüger e7560df897 Rollup merge of #150549 - patch-1, r=ChrisDenton
fix missing_panics_doc in `std::os::fd::owned`

https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
2026-01-08 22:21:16 +01:00
Matthias Krüger 836ff9c06d Rollup merge of #150533 - uefi-fs-rmdirall, r=ChrisDenton
std: sys: fs: uefi: Implement remove_dir_all

- Using the implementation from sys::fs::common since UEFI does not have a built-in for this functionality.

@rustbot label +O-UEFI
2026-01-08 22:21:15 +01:00
Matthias Krüger d21770710b Rollup merge of #150475 - uefi-fs-file, r=ChrisDenton
std: sys: fs: uefi: Implement initial File

- Implement basic opening and creating files.
- Also implement debug.

@rustbot label +O-UEFI
2026-01-08 22:21:15 +01:00
Matthias Krüger aee575713d Rollup merge of #149961 - add-optional-spellcheck-in-pre-hook, r=lolbinarycat
tidy: add if-installed prefix condition to extra checks system

Ref: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Should.20Spellcheck.20check.20all.20files.3F/with/543227610

tidy now runs spellcheck (typos-cli) without adding `--extra-checks=spellcheck` option if the tool is already installed under ./build/misc-tools and the version is expected.
It will improve code quality without bothering engineers who doesn't want to use typos or who cleans up ./build directory frequently.
2026-01-08 22:21:14 +01:00
rust-bors[bot] 31cd367b9c Auto merge of #148545 - cramertj:alloc-map, r=Amanieu
Add allocator parameter to HashMap

Hashbrown support originally added in https://github.com/rust-lang/hashbrown/pull/133
Part of https://github.com/rust-lang/wg-allocators/issues/7

~See also: hashset support in https://github.com/rust-lang/rust/pull/148550~ (Edit: merged into this PR for crater)
2026-01-08 20:22:35 +00:00
Clara Engler 1eb605f634 Query associated_item_def_ids when needed
This commit moves a query to `associated_item_defs` from above an error
condition caused independently of it to below it.

It looks generally cleaner and might potentially save some runtime in
case the error condition is met, rendering `items` to be left unused,
yet still queried.
2026-01-08 19:41:24 +01:00
rust-bors[bot] 4586feb998 Auto merge of #150810 - matthiaskrgr:rollup-fXh6V3q, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#149976 (Add waker_fn and local_waker_fn to std::task)
 - rust-lang/rust#150074 (Update provider API docs)
 - rust-lang/rust#150094 (`c_variadic`: provide our own `va_arg` implementation for more targets)
 - rust-lang/rust#150164 (rustc: Fix `-Zexport-executable-symbols` on wasm)
 - rust-lang/rust#150569 (Ensure that static initializers are acyclic for NVPTX)
 - rust-lang/rust#150694 (./x check miri: enable check_only feature)
 - rust-lang/rust#150717 (Thread `--jobs` from `bootstrap` -> `compiletest` -> `run-make-support`)
 - rust-lang/rust#150736 (Add AtomicPtr::null)
 - rust-lang/rust#150787 (Add myself as co-maintainer for s390x-unknown-linux-musl)
 - rust-lang/rust#150789 (Fix copy-n-paste error in `vtable_for` docs)

r? @ghost
2026-01-08 16:24:54 +00:00
human9000 9f3956f378 MGCA: literals support 2026-01-08 20:29:00 +05:00
Matthias Krüger 5a5740fb68 Rollup merge of #150789 - 2025-fix-vtable-for-comment, r=joboet
Fix copy-n-paste error in `vtable_for` docs

This is a safe function, which doesn't take a `ptr` parameter.
2026-01-08 16:25:33 +01:00
Matthias Krüger 0b98c6024b Rollup merge of #150787 - s390x-musl-co-maintainer, r=Noratrieb
Add myself as co-maintainer for s390x-unknown-linux-musl

Having two dedicated target maintainers is a prerequisite for promoting this target to tier 2. I've been in contact with Ulrich and he's agreed to having me as a co-maintainer in preparation for a MCP to promote it to tier 2.

cc @uweigand
2026-01-08 16:25:32 +01:00
Matthias Krüger eaff06187f Rollup merge of #150736 - atomic-ptr-null, r=joboet
Add AtomicPtr::null

Implementation for https://github.com/rust-lang/rust/issues/150733.

I marked this function as `#[must_use]` even though the other `AtomicPtr` constructors aren't. It's unclear to me why they aren't already marked as such, I opened a zulip thread asking about it: [#t-libs > Is there a reason AtomicPtr constructors aren't #&#91;must_use&#93;?](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Is.20there.20a.20reason.20AtomicPtr.20constructors.20aren't.20.23.5Bmust_use.5D.3F/with/566624261).
2026-01-08 16:25:31 +01:00
Matthias Krüger 7a11f8baee Rollup merge of #150717 - jobs, r=Kobzol
Thread `--jobs` from `bootstrap` -> `compiletest` -> `run-make-support`

Context is https://github.com/rust-lang/rust/pull/150524#issuecomment-3712701586, where we would like to thread the `--jobs` config from bootstrap explicitly through to run-make tests without relying on an "external env var" that bypasses the build/test infra.

Note that this PR currently intentionally couples the jobs configured for *builds*, versus for `TestMode::RunMake` tests. We can further specialize some kind of `run-make-jobs` bootstrap config *if actually needed*; I will keep this configuration naive for now.

r? @Kobzol
2026-01-08 16:25:31 +01:00
Matthias Krüger 219d95e9bc Rollup merge of #150694 - miri-check, r=clubby789,bjorn3
./x check miri: enable check_only feature

With this, we should no longer need to turn off the default features, so we can undo https://github.com/rust-lang/rust/pull/149550.

@bjorn3 you seem to have a test setup to check if this works properly in terms of skipping all the work that should not be required -- could you test if this PR works as intended?

FWIW we could now remove `default_features` from `run_tool_check_step`. Not sure if that's worth it.
2026-01-08 16:25:30 +01:00
Matthias Krüger 3481c0d3cb Rollup merge of #150569 - check_static_initializer_acyclic, r=workingjubilee
Ensure that static initializers are acyclic for NVPTX

NVPTX does not support cycles in static initializers (see rust-lang/rust#146787). LLVM produces an error when attempting to generate code for such constructs, like self-referential structs.

To avoid LLVM UB, we emit a post-monomorphization error on the Rust side before reaching codegen.

This is achieved by analyzing a subgraph of the "mono item graph" that only contains statics.
1. Calculate the strongly connected components (SCCs) of the graph.
2. Check for cycles (more than one node in an SCC or one node that references itself).
2026-01-08 16:25:30 +01:00
Matthias Krüger 023cc3cacc Rollup merge of #150164 - fix-wasm-export-executable-symbols, r=jdonszelmann
rustc: Fix `-Zexport-executable-symbols` on wasm

This commit reorders some cases in `export_symbols` in the linker implementation for wasm to ensure that the `is_like_wasm` case is handled before the catch-all `CrateType::Executable` case.
2026-01-08 16:25:29 +01:00
Matthias Krüger fc4464bf7b Rollup merge of #150094 - more-va-arg, r=workingjubilee
`c_variadic`: provide our own `va_arg` implementation for more targets

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

Provide our own implementations in order to guarantee the behavior of `va_arg`. We will only be able to stabilize `c_variadic` on targets where we know and guarantee the properties of `va_arg`.

r? workingjubilee
2026-01-08 16:25:28 +01:00
Jana Dönszelmann 6b88c6b7c2 store defids instead of symbol names in the aliases list 2026-01-08 16:25:27 +01:00
Matthias Krüger b3f95da910 Rollup merge of #150074 - provider-doc-update, r=Mark-Simulacrum
Update provider API docs

Adds guidance on a specific provider API implementation anti pattern that implementers of the error trait should avoid.

resolves https://github.com/rust-lang/rust/issues/99301#issuecomment-3661904330
2026-01-08 16:25:27 +01:00
Matthias Krüger 10ef3586d5 Rollup merge of #149976 - waker-fn, r=jhpratt
Add waker_fn and local_waker_fn to std::task

This refers to rust-lang/rust#149580.
2026-01-08 16:25:27 +01:00
Guillaume Gomez 27b1083a96 Update literal-escaper version to 0.0.7 2026-01-08 14:10:33 +01:00
bjorn3 aec8b69878 Minor cleanups to fn_abi_new_uncached 2026-01-08 10:49:44 +00:00
Folkert de Vries 3be74a7441 render intra-doc links in the #[deprectated] note 2026-01-08 11:35:33 +01:00
Folkert de Vries 64c78f6e74 make MarkdownItemInfo a field struct 2026-01-08 11:33:31 +01:00
Mateusz Mikuła 69bedd10d2 compiler-builtins: Enable AArch64 __chkstk for MinGW
Similarly to i686 and X86_64 MinGW targets, Rust needs to provide the
right chkstk symbol for AArch64 to avoid relying on the linker to
provide it.

CC https://github.com/rust-lang/rust/issues/150725
2026-01-08 05:01:35 -05:00
rust-bors[bot] 32fe406b5e Auto merge of #150538 - Kobzol:dist-cg-gcc-component, r=jieyouxu
Add a dist component for cg_gcc

try-job: dist-x86_64-linux
2026-01-08 09:53:23 +00:00
rust-bors[bot] bca37a20bd Auto merge of #150798 - matthiaskrgr:rollup-ANxstUE, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#150675 (MGCA: Support tuple expressions as direct const arguments)
 - rust-lang/rust#150696 (enrich error info when tries to dlopen Enzyme)
 - rust-lang/rust#150747 (tests/ui/runtime/on-broken-pipe/with-rustc_main.rs: Not needed so remove)
 - rust-lang/rust#150757 (Fix `alloc_error_handler` signature mismatch)
 - rust-lang/rust#150777 (Stabilize `slice::element_offset`)
 - rust-lang/rust#150791 (Remove out of date FIXME comment.)

r? @ghost
2026-01-08 06:38:08 +00:00
Matthias Krüger bfec56bfe0 Rollup merge of #150791 - w/mismatch, r=jieyouxu
Remove out of date FIXME comment.

Commit https://github.com/rust-lang/rust/pull/147526 removed the following code and replaced it with the `AllocatorMethod`. However, its input is empty, resulting in behavior inconsistent with the previous code.

```rust
  create_wrapper_function(
      tcx,
      &cx,
      &mangle_internal_symbol(tcx, "__rust_alloc_error_handler"),
      Some(&mangle_internal_symbol(tcx, alloc_error_handler_name(alloc_error_handler_kind))),
      &[usize, usize], // size, align
      None,
      true,
      &CodegenFnAttrs::new(),
  );
  ```

  resolves https://github.com/rust-lang/rust/issues/150755
2026-01-08 07:27:57 +01:00
Matthias Krüger e8217318c6 Rollup merge of #150777 - stabilize_elem_offset, r=jhpratt
Stabilize `slice::element_offset`

[slice::element_offset](https://doc.rust-lang.org/std/primitive.slice.html#method.element_offset)

Partially stabilizes rust-lang/rust#126769 (substr_range).

[FCP completed](https://github.com/rust-lang/rust/issues/126769#issuecomment-3458159941)

The other methods are [stalled because of the new range types](https://github.com/rust-lang/rust/issues/126769#issuecomment-3599721663), but this method doesn't use ranges.
2026-01-08 07:27:56 +01:00
Matthias Krüger 40e95e5061 Rollup merge of #150757 - rm-unneded-test, r=bjorn3
Fix `alloc_error_handler` signature mismatch

It was added in ddee45e1d7 ([here](https://github.com/rust-lang/rust/pull/97802/changes#diff-85dc642a7bdad363a9e37d2491230280fcd977391ba7a242bda2da9ddb55f654) to be specific) when SIGPIPE was controlled with an attribute on `fn main()` which meant it could also be combined with `#[rustc_main]`:

    #[unix_sigpipe = "sig_dfl"]
    #[rustc_main]
    fn rustc_main() {

The test stopped being needed in cde0cde151 when `#[unix_sigpipe = "..."]` was replaced by `-Zon-broken-pipe=...`. And it will not be needed when `-Zon-broken-pipe=...` is replaced by an Externally Implementable Item (see rust-lang/rust#150591). Let's remove this test.

Tracking issue:
- rust-lang/rust#150588
2026-01-08 07:27:56 +01:00
Matthias Krüger dadacb6589 Rollup merge of #150747 - fix/liloading-enzyme-err, r=lqd
tests/ui/runtime/on-broken-pipe/with-rustc_main.rs: Not needed so remove

related: https://github.com/rust-lang/rust/issues/145899#issuecomment-3705550673

print error from EnzymeWrapper::get_or_init(sysroot) as a note

r? @ZuseZ4

e.g.

1. when libEnzyme not found

```shell
$ rustc +stage1 -Z autodiff=Enable -C lto=fat src/main.rs
error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-21` folder in the sysroot candidates:
       * /Volumes/WD_BLACK_SN850X_HS_1TB/rust-lang/rust/build/aarch64-apple-darwin/stage1/lib
  |
  = note: it will be distributed via rustup in the future
```

2. when could not load libEnzyme successfully

```shell
rustc +stage1 -Z autodiff=Enable -C lto=fat src/main.rs
error: failed to load our autodiff backend: DlOpen { source: "dlopen(/Volumes/WD_BLACK_SN850X_HS_1TB/rust-lang/rust/build/aarch64-apple-darwin/stage1/lib/rustlib/aarch64-apple-darwin/lib/libEnzyme-21.dylib, 0x0005): tried: \'/Volumes/WD_BLACK_SN850X_HS_1TB/rust-lang/rust/build/aarch64-apple-darwin/stage1/lib/rustlib/aarch64-apple-darwin/lib/libEnzyme-21.dylib\' (slice is not valid mach-o file), \'/System/Volumes/Preboot/Cryptexes/OS/Volumes/WD_BLACK_SN850X_HS_1TB/rust-lang/rust/build/aarch64-apple-darwin/stage1/lib/rustlib/aarch64-apple-darwin/lib/libEnzyme-21.dylib\' (no such file), \'/Volumes/WD_BLACK_SN850X_HS_1TB/rust-lang/rust/build/aarch64-apple-darwin/stage1/lib/rustlib/aarch64-apple-darwin/lib/libEnzyme-21.dylib\' (slice is not valid mach-o file)" }
```
2026-01-08 07:27:55 +01:00
Matthias Krüger bb27147ba2 Rollup merge of #150696 - rm-FIXME, r=ZuseZ4
enrich error info when tries to dlopen Enzyme

In rust-lang/rust#127273 I added a test and a FIXME comment pointing out how it does the wrong thing. In the next commit I fixed the problem but forgot to remove the FIXME comment, whoops.
2026-01-08 07:27:54 +01:00
Matthias Krüger db2ab90c05 Rollup merge of #150675 - mgca/tuple-expr, r=BoxyUwU
MGCA: Support tuple expressions as direct const arguments

Tracking issue: rust-lang/rust#132980

Fixes rust-lang/rust#133965
Fixes rust-lang/rust#150613

r? @BoxyUwU
2026-01-08 07:27:54 +01:00
Nicholas Nethercote 65756bed80 Remove out of date FIXME comment.
In #127273 I added a test and a FIXME comment pointing out how it does
the wrong thing. In the next commit I fixed the problem but forgot to
remove the FIXME comment, whoops.
2026-01-08 14:54:26 +11:00
rust-bors[bot] 598c7bde38 Auto merge of #150783 - Kobzol:bors-email-update, r=jieyouxu
Update bors e-mail lookup

This should hopefully fix the post-merge CI workflow and git change detection in bootstrap.
2026-01-08 03:13:07 +00:00
Peter Todd a3b72d3de5 Fix copy-n-paste error in vtable_for docs
This is a safe function, which doesn't take a `ptr` parameter.
2026-01-08 02:11:03 +00:00
Aelin Reidel 600102c09b Add myself as co-maintainer for s390x-unknown-linux-musl
Having two dedicated target maintainers is a prerequisite for promoting
this target to tier 2. I've been in contact with Ulrich and he's agreed
to having me as a co-maintainer in preparation for a MCP to promote it to
tier 2.
2026-01-08 02:21:44 +01:00
rust-bors[bot] 548e586795 Auto merge of #150784 - Kobzol:rollup-0mvdoy5, r=Kobzol
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#150738 (Factorize `triagebot.toml` float parsing mentions with a glob matching)
 - rust-lang/rust#150761 (rustc book: fix grammar)
 - rust-lang/rust#150764 (Convert static lifetime to an nll var)
 - rust-lang/rust#150775 (Move issue-12660 to 'ui/cross-crate/ with a descriptive name)

r? @ghost
2026-01-07 23:59:12 +00:00
Jakub Beránek beb734bbfc Rollup merge of #150775 - main, r=Kivooeo
Move issue-12660 to 'ui/cross-crate/ with a descriptive name

Author: Immad Mir <mirimmad17@gmail.com>
2026-01-07 23:15:52 +01:00
Jakub Beránek 6b262f7eef Rollup merge of #150764 - map_regions_for_outlives, r=lcnr
Convert static lifetime to an nll var

Fixes rust-lang/rust#150648

I don't think this matters for any non 'static lifetimes as defining the struct as `Wrap<'a>` would mean the lifetime argument gets replaced with an nll var before MIR type checking meaning the struct tail is `dyn Trait + '?x`

r? types
2026-01-07 23:15:52 +01:00