Commit graph

314997 commits

Author SHA1 Message Date
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
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
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
Jakub Beránek
dbf905fea9
Rollup merge of #150761 - patch-1, r=wesleywiser
rustc book: fix grammar
2026-01-07 23:15:51 +01:00
Jakub Beránek
4cb5ccb53f
Rollup merge of #150738 - triagebot-first-glob-use, r=tgross35
Factorize `triagebot.toml` float parsing mentions with a glob matching

Related to https://github.com/rust-lang/triagebot/pull/2244.

r? @tgross35
2026-01-07 23:15:51 +01:00
Jakub Beránek
f2d0d52c2f
Remove unused environment variable
Its last use was removed in https://github.com/rust-lang/rust/pull/142827.
2026-01-07 22:50:35 +01:00
Jakub Beránek
138cc27f49
Update bors e-mail lookup 2026-01-07 22:45:41 +01:00
rust-bors[bot]
fecb335cba
Auto merge of #148339 - folkertdev:naked-macos-private-extern, r=Amanieu
naked functions: emit `.private_extern` on macos

fixes https://github.com/rust-lang/rust/issues/148307

Emit `.private_extern` on macos when the naked function uses `Linkage::Internal`. Failing to do so can cause issues with LTO.

The documentation on this directive is kind of sparse, but I believe this is at least not incorrect, and does fix the issue.

r? @Amanieu
cc @bjorn3
2026-01-07 20:38:46 +00:00
wr7
5548a84c87 Stabilize slice::element_offset 2026-01-07 10:57:20 -07:00
Immad Mir
870626a390 Move issue-12660 to 'ui/cross-crate/ with a descriptive name
Author: Immad Mir <mirimmad17@gmail.com>
2026-01-07 23:12:23 +05:30
Urgau
bbdba48aeb Update tidy check for triagebot path mentions with glob support 2026-01-07 18:28:22 +01:00
rust-bors[bot]
fc546b94ad
Auto merge of #150645 - GuillaumeGomez:rename-rustdoc-tests, r=Kobzol,Zalathar
Rename `tests/rustdoc` into `tests/rustdoc-html`

As discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/rename.20tests.2Frustdoc.20to.20rustdoc-html.3F/with/566142388), renaming this testsuite better reflects what they actually test. Later on, it could also allow us to add an alias to run all rustdoc tests at once.

r? @camelid
2026-01-07 16:21:28 +00:00
Boxy Uwu
3d965bdc28 Convert static lifetime to an nll var 2026-01-07 13:27:12 +00:00
Guillaume Gomez
8256623ab4 Update rustc-dev-guide about tests/rustdoc renamed into tests/rustdoc-html 2026-01-07 14:23:30 +01:00
Guillaume Gomez
a928f3352d Rename tests/rustdoc into tests/rustdoc-html 2026-01-07 14:23:30 +01:00
Tshepang Mbambo
5b4dbe0213
add missing commas 2026-01-07 14:53:21 +02:00
Tshepang Mbambo
43e1604def
rustc book: fix grammar 2026-01-07 14:51:18 +02:00
rust-bors[bot]
84c84421cc
Auto merge of #150759 - Kobzol:auto-branch, r=marcoieni
Make verify-channel.sh script compatible with new bors

It only dealt with the `auto` branch before.
2026-01-07 12:07:23 +00:00
Jakub Beránek
6f7313e8ad
Make verify-channel.sh script compatible with new bors 2026-01-07 13:06:27 +01:00
Spxg
f02ed7b565 Fix alloc_error_handler signature mismatch 2026-01-07 17:17:05 +08:00
Martin Nordholts
1132454616 tests/ui/runtime/on-broken-pipe/with-rustc_main.rs: Not needed so remove
It was added in ddee45e1d7 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() {

It stopped being needed 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.
Let's remove this test.
2026-01-07 06:03:51 +01:00
mu001999
6c2dc40666 Bless other tests 2026-01-07 09:33:40 +08:00
tison
6346d14202
Apply suggestion from @tisonkun 2026-01-07 09:31:59 +08:00
mu001999
cb1de29659 Use parent's identity_args to instantiate the type of const param 2026-01-07 08:44:32 +08:00
mu001999
d572e6d415 Add span field for ConstArg 2026-01-07 08:44:32 +08:00
mu001999
af76a2456d MGCA: Support tuple expressions as direct const arguments 2026-01-07 08:44:23 +08:00
bors
d9617c8d9a Auto merge of #150310 - JonathanBrouwer:cfg_trace2, r=jdonszelmann
Port `#[cfg]` and `#[cfg_attr]` trace attributes to the new attribute parsers

This PR converts `cfg` and `cfg_trace` attributes to the new parsed representation.

The primary challenge is that re-parsing these attributes in the HIR is a performance regression, since these attributes were only used in rustdoc and clippy parsing them in the HIR is extra work that was not done in the compiler before. To solve this, we only parse the attributes once and then store their parsed representation in the AST.
2026-01-06 22:59:32 +00:00
Urgau
bd0d0f707e Factorize triagebot float parsing mentions with a glob matching 2026-01-06 23:02:48 +01:00
bors
0aced202c2 Auto merge of #150729 - matthiaskrgr:rollup-an2m4zg, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#150026 (Fix macro_metavar_expr_concat behavior with nested repetitions)
 - rust-lang/rust#150521 (resolve: Rename "name bindings" to "name declarations")
 - rust-lang/rust#150704 (MGCA: Const constructors support)
 - rust-lang/rust#150728 (Cleanup some ui tests for const-traits)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-06 19:41:29 +00:00
Matthias Krüger
799c06fa9a
Rollup merge of #150728 - fee1-dead-contrib:const-traits-test-cleanup, r=fmease
Cleanup some ui tests for const-traits

r? project-const-traits

These tests pretty much behave as expected now.
2026-01-06 18:43:30 +01:00
Matthias Krüger
9c45483fe6
Rollup merge of #150704 - Kivooeo:const-ctor, r=BoxyUwU
MGCA: Const constructors support

part of https://github.com/rust-lang/rust/issues/132980

fixes rust-lang/rust#132985
fixes rust-lang/rust#136138
fixes rust-lang/rust#139596

r? BoxyUwU
2026-01-06 18:43:29 +01:00
Matthias Krüger
e5a2b25f4c
Rollup merge of #150521 - petrochenkov:decl, r=nnethercote
resolve: Rename "name bindings" to "name declarations"

This was discussed previously in some name resolution specification threads on zulip.
Link: [#t-compiler/help > understanding early name resolution of imports @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/understanding.20early.20name.20resolution.20of.20imports/near/545306658)

The main change is that `NameBinding` is renamed to `Decl`.
The `Name` part is skipped because almost everything in `rustc_resolve` is about names.
So in general the naming looks more compact now (`binding: NameBinding` -> `decl: Decl`).

I didn't rename *everything* including all the local variables, but did rename most of significant interfaces.
Late resolution in particular uses "bindings" in slightly different meanings, I didn't touch that.

Also, some interface comments are added/improved.

Renaming list:
- fn `define_binding_local` -> `plant_decl_into_local_module`
- fn `add_macro_use_binding` -> `add_macro_use_decl`
- fn `binding_description` -> `decl_description`
- enum `PendingBinding` -> `PendingDecl`
- field `ImportKind::Single::bindings` -> `ImportKind::Single::decls`
- field `NameResolution::non_glob_binding` -> `NameResolution::non_glob_decl`
- field `NameResolution::glob_binding` -> `NameResolution::glob_decl`
- fn `best_binding` -> `best_decl`
- fn `import` -> `new_import_decl`
- fn `try_define_local` -> `try_plant_decl_into_local_module`
- fn `new_ambiguity_binding` -> `new_decl_with_ambiguity`
- fn `new_warn_ambiguity_binding` -> `new_decl_with_warn_ambiguity`
- field `UnnecessaryQualification::binding` -> `UnnecessaryQualification::decl`
- struct `MacroRulesBinding` -> `MacroRulesDef`
- field `MacroRulesBinding::binding` -> `MacroRulesDef::decl`
- variant `MacroRulesScope::Binding` -> `MacroRulesScope::Def`
- enum `LexicalScopeBinding` -> `LateDecl`
- variant `LexicalScopeBinding::Item` -> `LateDecl::Decl`
- variant `LexicalScopeBinding::Res` -> `LateDecl::RibDef`
- field `ModuleData::self_binding` -> `ModuleData::self_decl`
- struct `NameBindingData` -> `DeclData`
- type `NameBinding` -> `Decl`
- enum `NameBindingKind` -> `DeclKind`
- variant `NameBindingKind::Res` -> `DeclKind::Def`
- field `NameBindingKind::Import::binding` -> `DeclKind::Import::source_decl`
- field `PrivacyError::binding` -> `PrivacyError::decl`
- field `ExternPreludeEntry::item_binding` -> `ExternPreludeEntry::item_decl`
- field `ExternPreludeEntry::flag_binding` -> `ExternPreludeEntry::flag_decl`
- field `Resolver::binding_parent_modules` -> `Resolver::decl_parent_modules`
- field `Resolver::dummy_binding` -> `Resolver::dummy_decl`
- field `Resolver::builtin_types_bindings` -> `Resolver::builtin_type_decls`
- field `Resolver::builtin_attrs_bindings` -> `Resolver::builtin_attr_decls`
- field `Resolver::registered_tool_bindings` -> `Resolver::registered_tool_decls`
- fn `ResolverArenas::new_res_binding` -> `ResolverArenas::new_def_decl`
- fn `ResolverArenas::new_pub_res_binding` -> `ResolverArenas::new_pub_def_decl`
- fn `ResolverArenas::alloc_name_binding` -> `ResolverArenas::alloc_decl`
- fn `ResolverArenas::alloc_macro_rules_binding` -> `ResolverArenas::alloc_macro_rules_def`
- fn `set_binding_parent_module` -> `set_decl_parent_module`
2026-01-06 18:43:28 +01:00
Matthias Krüger
8add20b77f
Rollup merge of #150026 - Delta17920:fix/150002-macro-concat-bug, r=jdonszelmann
Fix macro_metavar_expr_concat behavior with nested repetitions

**The Bug**: The `${concat(...)}` expression was using the wrong loop index when inside nested repetitions (like optional groups), causing it to get "stuck" on the first element and generate duplicate code.

**The Fix**: Updated `metavar_expr_concat` in `transcribe.rs` to correctly search the repetition stack (`tscx.repeats`) for the target variable instead of blindly using the last index.

**Tests**:
    Added `tests/ui/macros/concat-nested-repetition.rs.`

Fixes rust-lang/rust#150002
2026-01-06 18:43:28 +01:00
Deadbeef
d101412517 Cleanup some ui tests for const-traits 2026-01-06 17:23:16 +00:00
Folkert de Vries
76d0843f8d
naked functions: emit .private_extern on macos 2026-01-06 16:48:04 +01:00
sgasho
14ac6a1d3a Modified to output error messages appropriate to the situation 2026-01-07 00:33:57 +09:00
bors
4d73a008ea Auto merge of #150726 - JonathanBrouwer:rollup-yseerwy, r=JonathanBrouwer
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
 - rust-lang/rust#149880 (rustc_codegen_llvm: update alignment for double on AIX)
 - rust-lang/rust#150122 (Refactor function names of `rustc_ast_lowering`)
 - rust-lang/rust#150412 (use PIDFD_GET_INFO ioctl when available)
 - rust-lang/rust#150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
 - rust-lang/rust#150695 (MGCA: pretty printing for struct expressions and tuple calls )
 - rust-lang/rust#150698 (Improve comment clarity in candidate_may_shadow)
 - rust-lang/rust#150706 (Update wasm-component-ld)
 - rust-lang/rust#150707 (Fix ICE when transmute Assume field is invalid)
 - rust-lang/rust#150708 (Enable merge queue in new bors)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-06 15:22:37 +00:00
Vadim Petrochenkov
db26d01211 resolve: DeclKind::Import::binding -> DeclKind::Import::source_decl 2026-01-06 18:21:37 +03:00
Vadim Petrochenkov
a0ea3b0635 Update more function names and fields from bindings to declarations 2026-01-06 18:21:37 +03:00