Commit graph

315320 commits

Author SHA1 Message Date
Guillaume Gomez
ef1e4e65b7 Move checks from check_doc_attrs directly into rustc_attr_parsing 2026-01-11 18:36:03 +01:00
rust-bors[bot]
1279939b38
Auto merge of #150957 - matthiaskrgr:rollup-Cf6MsNU, r=matthiaskrgr
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`))
 - rust-lang/rust#150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file)
 - rust-lang/rust#150668 (Unix implementation for stdio set/take/replace)
 - rust-lang/rust#150743 (Reword the collect() docs)
 - rust-lang/rust#150776 (Fix the connect_error test on FreeBSD 15+)
 - rust-lang/rust#150781 (Use `rand` crate more idiomatically)
 - rust-lang/rust#150812 (Bump `diesel` to the most recent commit in `cargotest`)
 - rust-lang/rust#150862 (std: sys: fs: uefi: Implement File::flush)
 - rust-lang/rust#150873 (Reenable GCC CI download)
 - rust-lang/rust#150908 (llvm: Update `reliable_f16` configuration for LLVM22)
 - rust-lang/rust#150918 (std: sys: fs: uefi: Implement File::seek)
 - rust-lang/rust#150922 (Subscribe myself to attr parsing)
 - rust-lang/rust#150930 (Remove special case for `AllowedTargets::CrateLevel`)
 - rust-lang/rust#150942 (Port `#[rustc_has_incoherent_inherent_impls]` to attribute parser)

Failed merges:

 - rust-lang/rust#150943 (Port `#[must_not_suspend]` to attribute parser)

r? @ghost
2026-01-11 12:16:33 +00:00
Matthias Krüger
83924065f7
Rollup merge of #150942 - port_more_attrs, r=jdonszelmann
Port `#[rustc_has_incoherent_inherent_impls]` to attribute parser

Tracking issue: rust-lang/rust#131229
no tests changed here at all, so maybe we should add some but would like to know what kind of tests would be good to add

r? @JonathanBrouwer
2026-01-11 09:56:52 +01:00
Matthias Krüger
c6cf1c3ab8
Rollup merge of #150930 - crate_level, r=jdonszelmann
Remove special case for `AllowedTargets::CrateLevel`

r? @jdonszelmann
2026-01-11 09:56:51 +01:00
Matthias Krüger
7fd7eecf1f
Rollup merge of #150922 - subscribe-attr-parsing, r=Urgau
Subscribe myself to attr parsing
2026-01-11 09:56:51 +01:00
Matthias Krüger
3b1f270742
Rollup merge of #150918 - uefi-fs-seek, r=jhpratt
std: sys: fs: uefi: Implement File::seek

- Tested using OVMF on QEMU.

@rustbot label +O-UEFI
2026-01-11 09:56:50 +01:00
Matthias Krüger
cbdfa9167f
Rollup merge of #150908 - llvm-f16-cfg, r=nikic
llvm: Update `reliable_f16` configuration for LLVM22

Since yesterday, the LLVM `main` branch should have working `f16` on all platforms that Rust supports; this will be LLVM version 22, so update how `cfg(target_has_reliable_f16)` is set to reflect this.

Within the rust-lang organization, this currently has no effect. The goal is to start catching problems as early as possible in external CI that runs top-of-tree rust against top-of-tree LLVM, and once testing for the rust-lang bump to LLVM 22 starts. Hopefully this will mean that we can fix any problems that show up before the bump actually happens, meaning `f16` will be about ready for stabilization at that point (with some considerations for the GCC patch at [1] propagating).

References:

* 919021b0df
* 054ee2f870
* db26ce5c55
* 549d7c4f35
* 4903c6260c

[1]: 8b6a18ecaf
2026-01-11 09:56:50 +01:00
Matthias Krüger
55383badd3
Rollup merge of #150873 - reenable-gcc-download-ci, r=marcoieni
Reenable GCC CI download

Now that we have the `gcc-dev` artifacts on CI. However, I forgot to bump download-ci-gcc-stamp before 🤦 So I will also have to bump it for this PR.
2026-01-11 09:56:49 +01:00
Matthias Krüger
98270a95ed
Rollup merge of #150862 - uefi-fs-flush, r=the8472
std: sys: fs: uefi: Implement File::flush

- Also forward fsync and datasync to flush. UEFI does not have anything separate for metadata sync.

@rustbot label +O-UEFI
2026-01-11 09:56:49 +01:00
Matthias Krüger
1a1a11368d
Rollup merge of #150812 - bump-cargotest-diesel, r=Mark-Simulacrum
Bump `diesel` to the most recent commit in `cargotest`

`cargotest` can only detect the worst offenders (like tests failing, or hard compiler errors / ICEs), but regardless, bumping `diesel` to a way more recent version hopefully contributes slightly towards helping us not break `diesel` if at all possible.

That is, AFAIUI, this will not help catch [#t-compiler/prioritization/alerts > #149845 Diesel stops building with nightly-2025-12-10 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/245100-t-compiler.2Fprioritization.2Falerts/topic/.23149845.20Diesel.20stops.20building.20with.20nightly-2025-12-10/near/566975273) because we cap-lints to `warn` in `cargotest`.

Most recent commit as of the time of this PR anyway.
2026-01-11 09:56:42 +01:00
Matthias Krüger
57da460fc7
Rollup merge of #150781 - pr/cleanup-rand-usages, r=Mark-Simulacrum
Use `rand` crate more idiomatically

Small cleanup, found while working on something else.
We were using `rand` un-idiomatically in a couple of places, and it was bugging me...
2026-01-11 09:56:40 +01:00
Matthias Krüger
cf4ad6bf68
Rollup merge of #150776 - connect_error-fbsd15, r=Mark-Simulacrum
Fix the connect_error test on FreeBSD 15+

On FreeBSD 15, the error code returned in this situation changed.  It's now ENETUNREACH.  I think that error code is reasonable, and it's documented for connect(2), so we should expect that it might be returned.
2026-01-11 09:56:39 +01:00
Matthias Krüger
ea14ce5ca2
Rollup merge of #150743 - docs/iterator, r=Mark-Simulacrum
Reword the collect() docs

Update the `Iterator::collect` docs so they explain that the return type, not the iterator itself, determines which collection is built.

Follow up on rust-lang/rust#121140
2026-01-11 09:56:39 +01:00
Matthias Krüger
7a9ef99a56
Rollup merge of #150668 - stdio-swap, r=Mark-Simulacrum,RalfJung
Unix implementation for stdio set/take/replace

Tracking issue: https://github.com/rust-lang/rust/issues/150667
ACP: https://github.com/rust-lang/libs-team/issues/500
2026-01-11 09:56:38 +01:00
Matthias Krüger
f417f55e62
Rollup merge of #150368 - minicore-ordering, r=workingjubilee
adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file

this adds the `Ordering` enum to `minicore.rs`.

consequently, this updates `tests/assembly-llvm/rust-abi-arg-attr.rs` to import `minicore` directly. previously, this test file contained traits like `Copy` `Clone` `PointeeSized`, which were giving a duplicate lang item error, so replace those by importing `minicore` completely.
2026-01-11 09:56:38 +01:00
Matthias Krüger
30f9939a0c
Rollup merge of #148941 - stabilize-map-if, r=jhpratt
stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`)

# Stabilization report

## Summary

`#![feature(peekable_next_if_map)]` is a variation  of `next_if` on peekable iterators that can transform the peeked item. This creates a way to take ownership of the next item in an iterator when some condition holds, but put the item back when the condition doesn't hold. This pattern would otherwise have needed unwraps in many cases.

[Tracking issue](https://github.com/rust-lang/rust/issues/143702)

### What is stabilized

```rust
impl<I: Iterator> Peekable<I> {
    pub fn next_if_map<R>(
        &mut self,
        f: impl FnOnce(I::Item) -> Result<R, I::Item>,
    ) -> Option<R> {
        ..
    }
    pub fn next_if_map_mut<R>(
        &mut self,
        f: impl FnOnce(&mut I::Item) -> Option<R>,
    ) -> Option<R> {
        ..
    }
}
```

Example usage adapted from the ACP:

```rust
let mut it = Peekable::new("123".chars());

while let Some(digit) = it.next_if_map(|c| c.to_digit(10).ok_or(c)) {
    codepoint = codepoint * 10 + digit;
}
```

or with `next_if_map_mut`:

```rust
let mut it = Peekable::new("123".chars());

while let Some(digit) = iter.next_if_map_mut(|c| c.to_digit(10)) {
    line_num = line_num * 10 + digit;
}
```

Note that the major difference here is that `next_if_map_mut` does not get owned items from the iterator, but mutable references. With that api, the closure can return an `Option` which avoids an `ok_or`. This may require cloning or copying the iterator elements, so if that is expensive, the owned version, `next_if_map`, may be preferable.

### Nightly use

At the moment, this feature is barely used in nightly, though I've found multiple good uses for it in my own projects, hence my pushing for stabilization. It makes the kind of patterns used in recursive descent parsing super concise and maybe with its stabilization it will find more use.

### Test coverage

Besides a quite comprehensive doctest, this feature is tested (including panicking in the closure) here:

c880acdd31/library/coretests/tests/iter/adapters/peekable.rs (L275-L359)

## History

- ACP: https://github.com/rust-lang/libs-team/issues/613 accepted with https://github.com/rust-lang/libs-team/issues/613#issuecomment-3049844223
- implementation: https://github.com/rust-lang/rust/pull/143725 with tests, and no issues reported since july.

## Acknowledgments

ACP, implementation and tracking issue for this feature all by @kennytm <3
2026-01-11 09:56:37 +01:00
rust-bors[bot]
08f833aa17
Auto merge of #150540 - JonathanBrouwer:incremental_test, r=cjgillot
Also hash spans inside the same file as relative (V2)

Hashes spans relatively to their parent, even if they are not contained inside their parent.

Fixes https://github.com/rust-lang/rust/issues/150400

Closes https://github.com/rust-lang/rust/pull/143882, as this is a successor PR
This PR is very closely based on that PR with a few minor changes, so to give proper credit I made @cjgillot coauthor of the commit.
2026-01-11 08:54:50 +00:00
rust-bors[bot]
9bc8b40bc3
Auto merge of #150951 - Zalathar:rollup-xhWLriD, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#150947 (alloctests: Don't run the longer partial-sort tests under Miri)
 - rust-lang/rust#148196 (Implement create_dir_all() to operate iteratively instead of recursively)
 - rust-lang/rust#150494 ( Fix dso_local for external statics with linkage)
 - rust-lang/rust#150788 (THIR patterns: Replace `AscribeUserType` and `ExpandedConstant` wrappers with per-node data)
 - rust-lang/rust#150799 (Fix ICE: can't type-check body of DefId  for issue rust-lang/rust#148729)
 - rust-lang/rust#150804 (Remove std_detect_file_io and std_detect_dlsym_getauxval features)
 - rust-lang/rust#150852 (std: sys: fs: uefi: Implement File::write)
 - rust-lang/rust#150871 (Use f64 NaN in documentation instead of sqrt(-1.0))
 - rust-lang/rust#150878 (Emit an error for linking staticlibs on BPF)
 - rust-lang/rust#150911 (Add missing documentation for globs feature)
 - rust-lang/rust#150913 (compiler: Forward attributes to eii-expanded macros)
 - rust-lang/rust#150916 (Once again, reorganize the EII tests a bit)

r? @ghost
2026-01-11 03:30:55 +00:00
Stuart Cook
c6a3792972
Rollup merge of #150916 - eii-test-reorg, r=jieyouxu
Once again, reorganize the EII tests a bit

Some tests in the root of tests/ui/eii actually kind of belonged in the subfolders we made earlier
2026-01-11 14:28:06 +11:00
Stuart Cook
1987b15908
Rollup merge of #150913 - eii-macro-attrs, r=jdonszelmann
compiler: Forward attributes to eii-expanded macros

Since https://github.com/rust-lang/rust/pull/150592 is quite complicated to reason about I figured it would be good to split it up in smaller pieces that are easier to digest. Here is the attribute fix in isolation.

## The Problem

With this eii in **library/std/src/io/mod.rs**:
```rs
/// Foo
#[eii(on_broken_pipe)]
#[unstable(feature = "on_broken_pipe", issue = "150588")]
pub fn on_broken_pipe() -> OnBrokenPipe {
    OnBrokenPipe::BackwardsCompatible
}
```

you currently get this compilation error:

```
error: attribute macro has missing stability attribute
    --> library/std/src/io/mod.rs:2269:1
     |
2269 | #[eii(on_broken_pipe)]
     | ^^^^^^^^^^^^^^^^^^^^--
     | |
     | in this attribute macro expansion
     |
    ::: library/core/src/macros/mod.rs:1899:5
     |
1899 |     pub macro eii($item:item) {
     |     ------------- in this expansion of `#[eii]`
```

because with ` MAGIC_EXTRA_RUSTFLAGS=-Zunpretty=expanded ./x build library/std` we can see that a pub item in the expanded code is indeed missing that attribute:

```rs
const _: () =
    {
        #[on_broken_pipe]
        fn on_broken_pipe() -> OnBrokenPipe {
            OnBrokenPipe::BackwardsCompatible
        }
    };
unsafe extern "Rust" {
    /// Foo
    #[unstable(feature = "on_broken_pipe", issue = "150588")]
    #[rustc_eii_extern_item]
    pub safe fn on_broken_pipe()
    -> OnBrokenPipe;
}
#[rustc_builtin_macro(eii_shared_macro)]
#[eii_extern_target(on_broken_pipe)]
pub macro on_broken_pipe { () => {} }
```

## The Solution

With the fix, that error goes away because we get this expanded code instead:

```rs
const _: () =
    {
        #[on_broken_pipe]
        fn on_broken_pipe() -> OnBrokenPipe {
            OnBrokenPipe::BackwardsCompatible
        }
    };
unsafe extern "Rust" {
    /// Foo
    #[unstable(feature = "on_broken_pipe", issue = "150588")]
    #[rustc_eii_extern_item]
    pub safe fn on_broken_pipe()
    -> OnBrokenPipe;
}
/// Foo
#[unstable(feature = "on_broken_pipe", issue = "150588")]
#[rustc_builtin_macro(eii_shared_macro)]
#[eii_extern_target(on_broken_pipe)]
pub macro on_broken_pipe { () => {} }
```

Note that we also need to forward the docs, otherwise get get (fatal) warnings like these:

```
warning: missing documentation for an attribute macro
    --> library/std/src/io/mod.rs:2269:1
```

r? @jdonszelmann

Tracking issues:
- https://github.com/rust-lang/rust/issues/125418
- https://github.com/rust-lang/rust/issues/150588

### What about a test?

https://github.com/rust-lang/rust/pull/150591 will prevent regressions once it lands since it does not build without this fix. I think it is overkill to add a temporary eii to std before that.
2026-01-11 14:28:06 +11:00
Stuart Cook
c2448d7311
Rollup merge of #150911 - master, r=Kivooeo
Add missing documentation for globs feature

Fixes FIXME by documenting that globs enables wildcard imports (use module::*;).
2026-01-11 14:28:05 +11:00
Stuart Cook
5b685d7b03
Rollup merge of #150878 - bpf_staticlib_error, r=Urgau
Emit an error for linking staticlibs on BPF

Rather than panicking. Also a drive-by diagnostic type visibility reduction.

Fixes https://github.com/rust-lang/rust/issues/149432
2026-01-11 14:27:58 +11:00
Stuart Cook
72c9c8c801
Rollup merge of #150871 - simplify-partialord-doc, r=jhpratt
Use f64 NaN in documentation instead of sqrt(-1.0)
2026-01-11 14:27:57 +11:00
Stuart Cook
ebd5d75dbc
Rollup merge of #150852 - uefi-fs-write, r=joboet
std: sys: fs: uefi: Implement File::write

Tested using OVMF on QEMU.

@rustbot label +O-UEFI
2026-01-11 14:27:57 +11:00
Stuart Cook
26da51d2a0
Rollup merge of #150804 - std_detect_less_features, r=tgross35
Remove std_detect_file_io and std_detect_dlsym_getauxval features

They were introduced back when std_detect was a standalone crate published to crates.io. The [motivation](https://github.com/rust-lang/stdarch/issues/655) for `std_detect_dlsym_getauxval` was to allow using `getauxval` without `dlopen` when statically linking musl, which we now unconditionally do for musl. And for `std_detect_file_io` to allow `no_std` usage, which std_detect now supports even with that feature enabled as it directly uses libc. This also prevents accidentally disabling runtime feature detection when using `cargo build -Zbuild-std -Zbuild-std-features=`
2026-01-11 14:27:57 +11:00
Stuart Cook
e25d7a898a
Rollup merge of #150799 - mcga, r=BoxyUwU
Fix ICE: can't type-check body of DefId  for issue #148729

This commit fixes https://github.com/rust-lang/rust/issues/148729 for min_const_generic_args https://github.com/rust-lang/rust/issues/132980.

It's pretty small PR. The first commit makes sure that the `type_const`s are made into normal consts in const expressions.

The next one just handles the case https://github.com/rust-lang/rust/issues/148729 of where the type of the const was omitted at which point it was trying to treat a `type_const` again as a regular const. That obviously will fail since a type_const does not have a body.

@rustbot label +F-associated_const_equality +F-min_generic_const_args +I-ICE
2026-01-11 14:27:56 +11:00
Stuart Cook
8a5c66efb9
Rollup merge of #150788 - thir-pat, r=Nadrieril
THIR patterns: Replace `AscribeUserType` and `ExpandedConstant` wrappers with per-node data

This PR removes the `AscribeUserType` and `ExpandedConstant` variants from `thir::PatKind`, and replaces them with an `Option<Box<PatExtra>>` field attached to every `thir::Pat`.

### Why remove these variants?

Unlike other THIR pattern kinds, these variants are mere “wrappers” that exist to attach some additional information to an underlying pattern node.

There are several places where code that consumes THIR patterns needs to carefully “unpeel” any wrapper nodes, in order to match on the underlying pattern. This is clunky, and easy to forget to do, especially since it's not always obvious where the wrapper nodes can and can't appear.

Attaching the data to an optional per-node field makes it easier for consuming code to simply ignore the extra data when it is not relevant.

(One downside is that it is now easier to accidentally ignore the extra data when it *is* relevant, but I think that's generally a favourable tradeoff.)

### Impact

After this change, THIR pattern trees should be “logically identical” to the previous THIR pattern trees, in the sense that information that was carried by wrapper nodes should now be directly attached to the non-wrapper nodes that were being wrapped. Types and spans associated with THIR pattern nodes should (hopefully!) still be accurate.

There should be no change to the output of THIR-based checks or MIR building.
2026-01-11 14:27:56 +11:00
Stuart Cook
30585ebbd3
Rollup merge of #150494 - extern_linkage_dso_local, r=bjorn3
Fix dso_local for external statics with linkage

Tracking issue of the feature: rust-lang/rust#127488

DSO local attributes are not correctly applied to extern statics with `#[linkage = "foo"]` as we generate an internal global for such statics, and the we evaluate (and apply) DSO attributes on the internal one instead.

Fix this by applying DSO local attributes on the actually extern ones, too.
2026-01-11 14:27:55 +11:00
Stuart Cook
dda4963edb
Rollup merge of #148196 - std-fs-iterative-create-dir-all, r=Mark-Simulacrum,jhpratt
Implement create_dir_all() to operate iteratively instead of recursively

The current implementation of `create_dir_all(...)` in std::fs operates recursively. As mentioned in rust-lang/rust#124309, this could run into a stack overflow with big paths. To avoid this stack overflow issue, this PR implements the method in an iterative manner, preserving the documented behavior of:
```
Recursively create a directory and all of its parent components if they are missing.
This function is not atomic. If it returns an error, any parent components it was able to create will remain.
If the empty path is passed to this function, it always succeeds without creating any directories.
```
2026-01-11 14:27:55 +11:00
Stuart Cook
c680b74a33
Rollup merge of #150947 - partial-sort-miri, r=tgross35
alloctests: Don't run the longer partial-sort tests under Miri

These tests take hours to run in Miri, which greatly increases the duration of the `x86_64-gnu-aux` job, as observed in https://github.com/rust-lang/rust/pull/150900#issuecomment-3731837336.

- [Zulip thread in #t-infra](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/x86_64-gnu-aux.20job.20went.20from.20~2.20to.20~3.2E5.20hours/near/567354541)
2026-01-11 14:27:54 +11:00
Zalathar
50813939e4 Don't run the longer partial-sort tests under Miri 2026-01-11 12:04:46 +11:00
Edvin Bryntesson
76fcac2371
Port #[rustc_has_incoherent_inherent_impls] to attribute parser 2026-01-10 23:58:03 +01:00
rust-bors[bot]
ad04f76d84
Auto merge of #150912 - matthiaskrgr:rollup-SHXgjYS, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#150269 (Remove inactive nvptx maintainer)
 - rust-lang/rust#150713 (mgca: Type-check fields of struct expr const args)
 - rust-lang/rust#150765 (rustc_parse_format: improve error for missing `:` before `?` in format args)
 - rust-lang/rust#150847 (Fix broken documentation links to SipHash)
 - rust-lang/rust#150867 (rustdoc_json: Remove one call to `std::mem::take` in `after_krate`)
 - rust-lang/rust#150872 (Fix some loop block coercion diagnostics)
 - rust-lang/rust#150874 (Ignore `rustc-src-gpl` in fast try builds)
 - rust-lang/rust#150875 (Refactor artifact keep mode in bootstrap)
 - rust-lang/rust#150876 (Mention that `rustc_codegen_gcc` is a subtree in `rustc-dev-guide`)
 - rust-lang/rust#150882 (Supress unused_parens lint for guard patterns)
 - rust-lang/rust#150884 (Update bors email in CI postprocessing step)

Failed merges:

 - rust-lang/rust#150869 (Emit error instead of delayed bug when meeting mismatch type for const tuple)

r? @ghost
2026-01-10 22:52:39 +00:00
Ayush Singh
6878e73d26
std: sys: fs: uefi: Implement File::seek
- Tested using OVMF on QEMU.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-01-10 22:13:03 +05:30
rust-bors[bot]
f57eac1bf9
Auto merge of #146923 - oli-obk:comptime-reflect, r=BoxyUwU
Reflection MVP

I am opening this PR for discussion about the general design we should start out with, as there are various options (that are not too hard to transition between each other, so we should totally just pick one and go with it and reiterate later)

r? @scottmcm and @joshtriplett

project goal issue: https://github.com/rust-lang/rust-project-goals/issues/406
tracking issue: https://github.com/rust-lang/rust/issues/146922

The design currently implemented by this PR is

* `TypeId::info` (method, usually used as `id.info()` returns a `Type` struct
* the `Type` struct has fields that contain information about the type
* the most notable field is `kind`, which is a non-exhaustive enum over all possible type kinds and their specific information. So it has a `Tuple(Tuple)` variant, where the only field is a `Tuple` struct type that contains more information (The list of type ids that make up the tuple).
* To get nested type information (like the type of fields) you need to call `TypeId::info` again.
* There is only one language intrinsic to go from `TypeId` to `Type`, and it does all the work

An alternative design could be

* Lots of small methods (each backed by an intrinsic) on `TypeId` that return all the individual information pieces (size, align, number of fields, number of variants, ...)
* This is how C++ does it (see https://lemire.me/blog/2025/06/22/c26-will-include-compile-time-reflection-why-should-you-care/ and https://isocpp.org/files/papers/P2996R13.html#member-queries)
* Advantage: you only get the information you ask for, so it's probably cheaper if you get just one piece of information for lots of types (e.g. reimplementing size_of in terms of `TypeId::info` is likely expensive and wasteful)
* Disadvantage: lots of method calling (and `Option` return types, or "general" methods like `num_fields` returning 0 for primitives) instead of matching and field accesses
* a crates.io crate could implement `TypeId::info` in terms of this design

The backing implementation is modular enough that switching from one to the other is probably not an issue, and the alternative design could be easier for the CTFE engine's implementation, just not as nice to use for end users (without crates wrapping the logic)

One wart of this design that I'm fixing in separate branches is that `TypeId::info` will panic if used at runtime, while it should be uncallable
2026-01-10 15:00:14 +00:00
Jonathan Brouwer
da0dda1503
Remove special case for AllowedTargets::CrateLevel 2026-01-10 14:27:44 +01:00
Jonathan Brouwer
00ad671406
Subscribe myself to attr parsing 2026-01-10 13:00:07 +01:00
Jana Dönszelmann
9b811544f2
once again reorganize the EII tests a bit 2026-01-10 11:10:44 +01:00
Martin Nordholts
a0df7b2ad5 compiler: Forward attributes to eii-expanded macros
Otherwise you get errors like these if you have an Externally
Implementable Item defined in std:

    error: attribute macro has missing stability attribute
        --> library/std/src/io/mod.rs:2269:1
         |
    2269 | #[eii(on_broken_pipe)]
         | ^^^^^^^^^^^^^^^^^^^^--
         | |
         | in this attribute macro expansion
         |
        ::: library/core/src/macros/mod.rs:1899:5
         |
    1899 |     pub macro eii($item:item) {
         |     ------------- in this expansion of `#[eii]`

Or (fatal) warnings like these:

    warning: missing documentation for an attribute macro
        --> library/std/src/io/mod.rs:2269:1
2026-01-10 10:04:40 +01:00
Matthias Krüger
93993090c8
Rollup merge of #150884 - bors-email-ci, r=jieyouxu
Update bors email in CI postprocessing step

This was breaking CI job summaries. I don't think we have to backport it, should be mostly harmless.
2026-01-10 08:34:08 +01:00
Matthias Krüger
e7b08033a2
Rollup merge of #150882 - issue-149594, r=JonathanBrouwer
Supress unused_parens lint for guard patterns

Fixes rust-lang/rust#149594
2026-01-10 08:34:08 +01:00
Matthias Krüger
0161646212
Rollup merge of #150876 - gcc-dev-guide, r=Kobzol
Mention that `rustc_codegen_gcc` is a subtree in `rustc-dev-guide`

Was asked on [zulip](https://rust-lang.zulipchat.com/#narrow/channel/386786-rustc-codegen-gcc/topic/Subtree.20handling/with/564354089).

r? @RalfJung
2026-01-10 08:34:07 +01:00
Matthias Krüger
980e6ad91d
Rollup merge of #150875 - bootstrap-refactor-build-outputs, r=bjorn3
Refactor artifact keep mode in bootstrap

This makes it easier to understand which artifacts will be stored in the build stamp. Should help with https://github.com/rust-lang/rust/pull/145343.

Before, there were two booleans (keep .rmeta files and a special mode for rustc). I created an explicit enum for it instead. The mapping is:
- `(false, false)` => `ArtifactKeepMode::OnlyRlib`
- `(true, false)` => `ArtifactKeepMode::OnlyRmeta` (used for check/clippy builds)
- `(false, true)` => special rustc mode

r? @bjorn3
2026-01-10 08:34:00 +01:00
Matthias Krüger
da772d5195
Rollup merge of #150874 - fast-try-build-src-gpl, r=jieyouxu
Ignore `rustc-src-gpl` in fast try builds

I noticed that fast try builds now build this new component (unnecessarily).
2026-01-10 08:33:59 +01:00
Matthias Krüger
86806ab019
Rollup merge of #150872 - issue-150850, r=dianne
Fix some loop block coercion diagnostics

Fixes rust-lang/rust#150850
2026-01-10 08:33:58 +01:00
Matthias Krüger
68bd262521
Rollup merge of #150867 - chore-librustdoc-json-mem-take, r=GuillaumeGomez
rustdoc_json: Remove one call to `std::mem::take` in `after_krate`

This patch removes one call to `std::mem::take` to save two `memcpy`s: `JsonRenderer::index` can be quite large as noted https://github.com/rust-lang/rust/pull/142335. `self.index` can be passed directly to `types::Crate`. This removal makes `self` immutable.

The private `serialize_and_write` method is moved as a function: the `self` argument is replaced by `sess: &Session`. This `&Session` was fetched earlier in `after_krate` in all cases. This change allows to call `serialize_and_write` after `output_crate` is created, without having a conflict around the move of `self`: the borrow checker is now happy.

I wasn't able to measure the performance impact though because I don't know how to modify `rustc-perf` as [@nnethercote  did](https://github.com/rust-lang/rust/pull/142335#issuecomment-2961252113) (sorry).

---

Follow up of https://github.com/rust-lang/rust/pull/142335.

r? @nnethercote
2026-01-10 08:33:58 +01:00
Matthias Krüger
6ab61b336d
Rollup merge of #150847 - siphash-doc-link, r=joboet
Fix broken documentation links to SipHash

The documentation of `SipHasher` previously linked to a page about SipHash on https://131002.net, a domain registered to Jean-Philippe Aumasson, one of the co-authors of the original SipHash paper (alongside Daniel J Bernstein).

That domain now redirects to another of Mr Aumasson's domains, https://www.aumasson.jp, but which does not host a similar page dedicated to SipHash.  Instead, his site links to a GitHub repository containing a C implementation together with links to the original research paper.  Mr Bernstein's own site, https://cr.yp.to, only hosts a copy of the research paper.

Therefore the GitHub repository appears to be the most official and complete reference to which we can link.

Fixes rust-lang/rust#150806
r? reddevilmidzy
2026-01-10 08:33:57 +01:00
Matthias Krüger
a8d66d4670
Rollup merge of #150765 - ua/missing-colon, r=estebank
rustc_parse_format: improve error for missing `:` before `?` in format args

Detect the `{ident?}` pattern where `?` is immediately followed by `}` and emit a clearer diagnostic explaining that `:` is required for Debug formatting. This avoids falling back to a generic “invalid format string” error and adds a targeted UI test for the case.
2026-01-10 08:33:57 +01:00
Matthias Krüger
727688a8e4
Rollup merge of #150713 - mgca-typeck-struct-fields, r=BoxyUwU
mgca: Type-check fields of struct expr const args

Fixes rust-lang/rust#150623.
Fixes rust-lang/rust#150712. Fixes rust-lang/rust#150714. Fixes rust-lang/rust#150734.

r? @BoxyUwU
2026-01-10 08:33:56 +01:00
Matthias Krüger
1df4902575
Rollup merge of #150269 - update-nvptx-maintainers, r=jieyouxu
Remove inactive nvptx maintainer

Since I just saw the discussion in [#t-compiler > Starting to enforce Tier 2-to-3 downgrade](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Starting.20to.20enforce.20Tier.202-to-3.20downgrade/with/564788312), and I saw him pinged on PRs or issues. His last active open-source contributions were in early 2022: https://github.com/RDambrosio016 and IIRC he also mentioned that he had moved on.

ping @RDambrosio016 so you can confirm or correct me, if you want to chime in. I also pinged him on Zulip.

cc @kjetilkjeka who is the other maintainer and active on related issues/prs for his target.

I'd leave it open for a while, but
r? @jieyouxu
2026-01-10 08:33:56 +01:00