Commit graph

316246 commits

Author SHA1 Message Date
Chayim Refael Friedman
d02e33db2d Handle Self::EnumVariant and Self on traits in doclinks 2026-01-26 18:40:51 +02:00
Lukas Wirth
45ef76624e
Merge pull request #21518 from pksunkara/pavan/jj/uwxtukzt
internal: Use parser expect where possible
2026-01-25 10:00:58 +00:00
Pavan Kumar Sunkara
cb603ad590 internal: Use parser expect where possible 2026-01-25 07:40:32 +05:30
Lukas Wirth
a4434986f5
Merge pull request #21501 from robertoaloi/ra-bump-notify
Bump notify from 8.0.0. to 8.2.0
2026-01-24 17:32:18 +00:00
Lukas Wirth
af21cbe926
Merge pull request #21479 from Shourya742/2026-01-15-add-bidirectional-test-flow
Add bidirectional test flow
2026-01-24 13:45:23 +00:00
Lukas Wirth
b5bb005e66
Merge pull request #21509 from Veykril/push-zwownxpqxrnw
internal: Add tests for rust-lang/rust#146972
2026-01-23 11:07:19 +00:00
Lukas Wirth
4e9e37ee58 internal: Add tests for rust-lang/rust#146972 2026-01-23 11:57:14 +01:00
Laurențiu Nicola
42d99422c2
Merge pull request #21506 from rust-lang/rustc-pull
minor: Rustc pull update
2026-01-22 06:53:20 +00:00
The rustc-josh-sync Cronjob Bot
ee0fabd98a Merge ref '004d710faf' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@004d710faf
Filtered ref: rust-lang/rust-analyzer@fa83348961
Upstream diff: b6fdaf2a15...004d710faf

This merge was created using https://github.com/rust-lang/josh-sync.
2026-01-22 04:25:48 +00:00
Urgau
dd84a4fc0f Add documentation for --remap-path-prefix and doc scope in rustdoc 2026-01-24 15:33:21 +01:00
Urgau
3d6a5b5158 Make sure the documentation scope doesn't imply other scopes 2026-01-24 15:33:21 +01:00
Urgau
fbab2c0e92 Make rustdoc use the documentation remapping scope and cleanups 2026-01-24 15:33:21 +01:00
Urgau
91e3e2a37f Add the remapping path documentation scope for rustdoc usage 2026-01-24 15:33:21 +01:00
Urgau
ee6dd56425 Add test for invalid --remap-path-scope arguments 2026-01-22 22:44:09 +01:00
bors
0f145634fc Auto merge of #151490 - JonathanBrouwer:rollup-ovStnQE, r=JonathanBrouwer
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#151001 (rustdoc: render doc(hidden) as a code attribute)
 - rust-lang/rust#151042 (fix fallback impl for select_unpredictable intrinsic)
 - rust-lang/rust#151220 (option: Use Option::map in Option::cloned)
 - rust-lang/rust#151260 (Handle unevaluated ConstKind in in_operand)
 - rust-lang/rust#151296 (MGCA: Fix incorrect pretty printing of valtree arrays)
 - rust-lang/rust#151423 (Move assert_matches to planned stable path)
 - rust-lang/rust#151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - rust-lang/rust#151465 (codegen: clarify some variable names around function calls)
 - rust-lang/rust#151468 (fix `f16` doctest FIXMEs)
 - rust-lang/rust#151469 (llvm: Tolerate dead_on_return attribute changes)
 - rust-lang/rust#151476 (Avoid `-> ()` in derived functions.)

r? @ghost
2026-01-22 14:53:11 +00:00
Jonathan Brouwer
d86afd2ec0
Rollup merge of #151476 - nnethercote:no-unit-ret-ty-in-derive, r=Kobzol
Avoid `-> ()` in derived functions.

`hash` and `assert_receiver_is_total_eq` have no return type. This commit removes the `-> ()` that is currently printed for them.

r? @Kobzol
2026-01-22 13:35:44 +01:00
Jonathan Brouwer
797601b84c
Rollup merge of #151469 - maurer:dead-on-return, r=nikic
llvm: Tolerate dead_on_return attribute changes

The attribute now has a size parameter and sorts differently. Adjust tests to tolerate this.

https://github.com/llvm/llvm-project/pull/171712

r? durin42

@rustbot label llvm-main
2026-01-22 13:35:43 +01:00
Jonathan Brouwer
4d631df8b4
Rollup merge of #151468 - folkertdev:f16-fixmes, r=tgross35
fix `f16` doctest FIXMEs

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

Remove a bunch of fixmes, and run docs tests on all targets that (should) support them.

r? tgross35
2026-01-22 13:35:43 +01:00
Jonathan Brouwer
704eaef9d4
Rollup merge of #151465 - RalfJung:fn-call-vars, r=mati865
codegen: clarify some variable names around function calls

I looked at rust-lang/rust#145932 to try to understand how it works, and quickly got lost in the variable names -- what refers to the caller, what to the callee? So here's my attempt at making those more clear. Hopefully the new names are correct.^^

Cc @JamieCunliffe
2026-01-22 13:35:42 +01:00
Jonathan Brouwer
5cccc7ca02
Rollup merge of #151441 - Keith-Cancel:mgca3, r=BoxyUwU
Fix ICE: Don't try to evaluate type_consts when eagerly collecting items

This fixes https://github.com/rust-lang/rust/issues/151246

The change is pretty straightforward if the Monomorphization strategy is eager which `-Clink-dead-code=true` sets. This then would lead to the existing code to try and evaluate a `type const` which does not have a body to evaluate leading to an ICE. The change is pretty straight forward just skip over type consts.

This also seems like a sensible choice to me since a MonoItem can only be a Fn, Static, or Asm. A type const is none of the aforementioned.

And even if it was added to the MonoItems list it would then later fail this check:
fe98ddcfcf/compiler/rustc_monomorphize/src/collector.rs (L438-L440)
Since that explicitly checks that the MonoItem's `DefKind` is static and not anything else.

One more change is the addition of a simple test of the example code from https://github.com/rust-lang/rust/issues/151246 that checks that code compiles successfully with `-Clink-dead-code=true`.

The only other change was to make the guard checks a little easier to read by making the logic more linear instead of one big if statement.

r? @BoxyUwU
@rustbot label +F-associated_const_equality +F-min_generic_const_args
2026-01-22 13:35:42 +01:00
Jonathan Brouwer
f03c1a2bd3
Rollup merge of #151423 - Voultapher:move-assert-matches, r=Amanieu
Move assert_matches to planned stable path

Another prep PR for https://github.com/rust-lang/rust/pull/137487
2026-01-22 13:35:41 +01:00
Jonathan Brouwer
96a40e9ac3
Rollup merge of #151296 - Human9000-bit:const-array-mir-dump-fix, r=BoxyUwU
MGCA: Fix incorrect pretty printing of valtree arrays

Fixes rust-lang/rust#151126

- **add failing test**
- **fix: additional check whether const array could be printed as raw bytes**

As I figured out, the problem was in `pretty_print_const_valtree`, where it tried to print unevaluated consts as if they were evaluated, which resulted in ICE.
2026-01-22 13:35:41 +01:00
Jonathan Brouwer
0fc86d8fa0
Rollup merge of #151260 - reddevilmidzy:type_const, r=BoxyUwU
Handle unevaluated ConstKind in in_operand

fix: rust-lang/rust#151248

r? BoxyUwU
~~I can't reproduce rust-lang/rust#151246 in my local(x86_64-pc-windows-msvc) even before this change. 🤔
create a draft and test it in different environments.~~
2026-01-22 13:35:40 +01:00
Jonathan Brouwer
4fb420afa5
Rollup merge of #151220 - cvengler:map-option, r=tgross35
option: Use Option::map in Option::cloned

This commit removes a repetitive match statement in favor of Option::map for Option::cloned.
2026-01-22 13:35:39 +01:00
Jonathan Brouwer
ddd8965d79
Rollup merge of #151042 - RedDaedalus:fix-select-unpredictable-fallback, r=RalfJung
fix fallback impl for select_unpredictable intrinsic

`intrinsics::select_unpredictable` does not drop the value that is not selected, but the fallback impl did not consider this behavior. This creates an observable difference between Miri and actual execution, and possibly does not play well with the `core::hint` version which has extra logic to drop the value that was not selected.
```rust
#![feature(core_intrinsics)]

fn main() {
    core::intrinsics::select_unpredictable(true, LoudDrop(0), LoudDrop(1));
    // cargo run: "0"; cargo miri run: "1 0"
}

struct LoudDrop(u8);

impl Drop for LoudDrop {
    fn drop(&mut self) {
        print!("{} ", self.0);
    }
}
```

This change let me remove the `T: [const] Destruct` bound as well, since the destructor is no longer relevant.
2026-01-22 13:35:39 +01:00
Jonathan Brouwer
83ffa35979
Rollup merge of #151001 - chojs23:fix/hidden-attr-docs, r=GuillaumeGomez
rustdoc: render doc(hidden) as a code attribute

Move `#[doc(hidden)]` into the shared code-attribute renderer so it matches the styling and placement of other attributes in rustdoc HTML.

Closes rust-lang/rust#132304
2026-01-22 13:35:38 +01:00
human9000
ff97a6a7f4 fix: allow to print const array as raw bytes only if possible to do so 2026-01-22 15:06:22 +05:00
Folkert de Vries
6c3b9f2946
f16: run more tests on supported platforms
and only require `target_has_reliable_f16_math` for `abs` and
`copysign`.
2026-01-22 09:39:50 +01:00
bors
d29e4783df Auto merge of #151480 - jhpratt:rollup-kUkiF2m, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#151118 (Support slices in type reflection)
 - rust-lang/rust#151439 (Bump bootstrap compiler to 1.94)
 - rust-lang/rust#151442 (Port `#![crate_type]` to the attribute parser)
 - rust-lang/rust#151457 (Improve error message for assert!() macro in functions returning bool)

r? @ghost
2026-01-22 07:33:21 +00:00
Jacob Pratt
d43b667377
Rollup merge of #151457 - enthropy7:fix-assert-macro-only, r=enthropy7
Improve error message for assert!() macro in functions returning bool

Detect `assert!()` macro in error messages and provide clearer diagnostics

When `assert!()` is used in a function returning a value, show a message explaining that `assert!()` doesn't return a value, instead of the generic "if may be missing an else clause" error.

Fixes rust-lang/rust#151446
2026-01-22 00:37:44 -05:00
Jacob Pratt
512cc8d785
Rollup merge of #151442 - clubby789:crate-type-port, r=JonathanBrouwer
Port `#![crate_type]` to the attribute parser

Tracking issue: https://github.com/rust-lang/rust/issues/131229

~~Note that the actual parsing that is used in the compiler session is unchanged, as it must happen very early on; this just ports the validation logic.~~

Also added `// tidy-alphabetical-start` to `check_attr.rs` to make it a bit less conflict-prone
2026-01-22 00:37:43 -05:00
Jacob Pratt
4a983e0900
Rollup merge of #151439 - Mark-Simulacrum:bootstrap-bump, r=nnethercote
Bump bootstrap compiler to 1.94

https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday
2026-01-22 00:37:43 -05:00
Jacob Pratt
a4cf93bccc
Rollup merge of #151118 - BD103:reflect-slices, r=oli-obk
Support slices in type reflection

Tracking issue: rust-lang/rust#146922

This PR adds support for inspecting slices `[T]` through type reflection. It does so by adding the new `Slice` struct + variant, which is very similar to `Array` but without the `len` field:

```rust
pub struct Slice {
    pub element_ty: TypeId,
}
```

Here is an example reflecting a slice:

```rust
match const { Type::of::<[u8]>() }.kind {
    TypeKind::Slice(slice) => assert_eq!(slice.element_ty, TypeId::of::<u8>()),
    _ => unreachable!(),
}
```

In addition to this, I also re-arranged the type info unit tests.

r? @oli-obk
2026-01-22 00:37:42 -05:00
The rustc-josh-sync Cronjob Bot
6753155bd6 Prepare for merging from rust-lang/rust
This updates the rust-version file to 004d710faf.
2026-01-22 04:25:38 +00:00
Nicholas Nethercote
ced38b51fb Avoid -> () in derived functions.
`hash` and `assert_receiver_is_total_eq` have no return type. This
commit removes the `-> ()` that is currently printed for them.
2026-01-22 14:13:55 +11:00
Jamie Hill-Daniel
e73dfaa62f Move collect_crate_types to rustc_interface, and use new attribute parser 2026-01-22 02:34:28 +00:00
Jamie Hill-Daniel
66b78b700b Port crate_type to attribute parser 2026-01-22 02:34:28 +00:00
Jamie Hill-Daniel
8a1d6d319b Add test for malformed and misapplied crate_type 2026-01-22 02:30:56 +00:00
Jamie Hill-Daniel
e902d0512c Sort do-nothing attributes in check_attributes 2026-01-22 02:30:55 +00:00
bors
b765963267 Auto merge of #150843 - fmease:dyn-ace, r=BoxyUwU
mGCA: Make trait object types with type-level associated consts dyn compatible

Under feature `min_generic_const_args` (mGCA) (rust-lang/rust#132980), render traits with non-parametrized type-level associated constants (i.e., `#[type_const]` ones) dyn compatible but force the user to specify all type-level associated consts in the trait object type via bindings (either directly, via supertrait bounds and/or behind trait aliases) just like associated types, their sibling.

Fixes rust-lang/rust#130300 (feature request).
Fixes rust-lang/rust#136063 (bug).
Fixes rust-lang/rust#137260 (bug).
Fixes rust-lang/rust#137514 (bug).

While I'm accounting for most illegal `Self` references via const projections & params, I'm intentionally ignoring RUST-123140 (and duplicates) in this PR which is to be tackled some other time.

Additional context: Crate `rustc-demangle` had to be updated to fix v0 demangling. I've patched it in PR https://github.com/rust-lang/rustc-demangle/pull/87 which was was released in version 0.1.27 via PR https://github.com/rust-lang/rustc-demangle/pull/88.
2026-01-22 01:56:41 +00:00
Mark Rousskov
3dc7a1f33b Bump stage0 2026-01-21 20:03:56 -05:00
neo
b4c4d95950 rustdoc: render doc(hidden) as a code attribute
Move `#[doc(hidden)]` into the shared code-attribute renderer so it
matches the styling and placement of other attributes in rustdoc HTML.
2026-01-22 09:15:53 +09:00
Matthew Maurer
b639b0a4d8 llvm: Tolerate dead_on_return attribute changes
The attribute now has a size parameter and sorts differently:
* Explicitly omit size parameter during construction on 23+
* Tolerate alternate sorting in tests

https://github.com/llvm/llvm-project/pull/171712
2026-01-21 23:39:03 +00:00
bors
004d710faf Auto merge of #151471 - JonathanBrouwer:rollup-EgxENYU, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151010 (std: use `ByteStr`'s `Display` for `OsStr`)
 - rust-lang/rust#151156 (Add GCC and the GCC codegen backend to build-manifest and rustup)
 - rust-lang/rust#151219 (Fixed ICE when using function pointer as const generic parameter)
 - rust-lang/rust#151343 (Port some crate level attrs to the attribute parser)
 - rust-lang/rust#151463 (add x86_64-unknown-linux-gnuasan to CI)

r? @ghost
2026-01-21 22:38:46 +00:00
Lukas Bergdoll
58be5d6620 Move assert_matches to planned stable path 2026-01-21 23:17:24 +01:00
BD103
a509588fa9 feat: support slices in reflection type info 2026-01-21 16:03:00 -06:00
enthropy7
95b58ac6ac
Improve error message for assert!() macro in functions returning bool 2026-01-22 00:49:56 +03:00
Jonathan Brouwer
5be6218b7f
Rollup merge of #151463 - jakos-sec:create-asan-target, r=Kobzol
add x86_64-unknown-linux-gnuasan to CI

Since it is a tier 2 target it should also be built by the CI workflow.
2026-01-21 22:24:04 +01:00
Jonathan Brouwer
18504a1f7b
Rollup merge of #151343 - Ozzy1423:attrs2, r=JonathanBrouwer
Port some crate level attrs to the attribute parser

Tracking issue: https://github.com/rust-lang/rust/issues/131229

Ports compiler_builtins, panic_runtime, needs_panic_runtime, profiler_runtime and no_builtins to the attribute parsing infrastructure.

r? @JonathanBrouwer
2026-01-21 22:24:03 +01:00
Jonathan Brouwer
afc18426cb
Rollup merge of #151219 - enthropy7:main, r=BoxyUwU
Fixed ICE when using function pointer as const generic parameter

added bounds check in prohibit_explicit_late_bound_lifetimes to prevent index out of bounds panic when args.args is empty. also regression test here to ensure function pointers in const generics produce proper error messages instead of ICE.

Fixes rust-lang/rust#151186
Fixes rust-lang/rust#137084
2026-01-21 22:24:03 +01:00