Commit graph

316102 commits

Author SHA1 Message Date
Ralf Jung
4cd367f029 fix readdir on freebsd, and minor tweaks 2026-01-23 18:09:23 +01:00
Islam-Imad
b17a22f675 used readdir_r for mac OS
update .gitignore to ignore zed files
2026-01-23 18:09:23 +01:00
Islam-Imad
adeb4df788 Unify readdir shim across Unix targets and add test 2026-01-23 18:09:12 +01:00
Ralf Jung
3159e8053a
Merge pull request #4824 from Islam-Imad/test-libc-opendir-closedir
Add test for libc opendir and closedir
2026-01-23 16:30:54 +00:00
Ralf Jung
e4e57e5a6e
Merge pull request #4825 from rust-lang/rustup-2026-01-23
Automatic Rustup
2026-01-23 07:11:16 +00:00
The Miri Cronjob Bot
bf04398434 Merge ref 'd10ac47c20' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@d10ac47c20
Filtered ref: rust-lang/miri@79d95ebc75
Upstream diff: d276646872...d10ac47c20

This merge was created using https://github.com/rust-lang/josh-sync.
2026-01-23 05:10:22 +00:00
The Miri Cronjob Bot
9b30ff44be Prepare for merging from rust-lang/rust
This updates the rust-version file to d10ac47c20.
2026-01-23 05:02:11 +00:00
bors
d10ac47c20 Auto merge of #151506 - JonathanBrouwer:rollup-MDuFdim, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#151412 (diagnostics: suggest deriving Default for enums)
 - rust-lang/rust#151495 (Fix ICE when using zero-length SIMD type in extern static)
 - rust-lang/rust#151497 (Fix typo: 'recieve' -> 'receive' in lldb-visualizers.md)

r? @ghost
2026-01-22 21:26:11 +00:00
Jonathan Brouwer
04246defca
Rollup merge of #151497 - bodhisilberling-2027:fix-typo-recieve-receive, r=tshepang
Fix typo: 'recieve' -> 'receive' in lldb-visualizers.md
2026-01-22 20:42:12 +01:00
Jonathan Brouwer
cbab2f0237
Rollup merge of #151495 - enthropy7:fix-simd-zero-length-extern-static, r=JonathanBrouwer
Fix ICE when using zero-length SIMD type in extern static

before my fix using a zero-length SIMD type in an extern static would cause an internal compiler error. now it properly shows a diagnostic error instead of panicking. it was because `LayoutError::InvalidSimd` wasn't handled in `check_static_inhabited` and fell through to a generic `delayed_bug`.

i added handling for `InvalidSimd` in `check_static_inhabited` (similar to `SizeOverflow`): when a SIMD type has an invalid layout, we call `emit_err` with `Spanned` to emit a normal error instead of an ICE. compiler now emits a clear error `"the SIMD type Simd<u8, 0> has zero elements"` with the correct span on the type, matching expected compiler behavior.

fixes rust-lang/rust#151451
2026-01-22 20:42:11 +01:00
Jonathan Brouwer
a2c53d6e4b
Rollup merge of #151412 - WhyNovaa:diagnostics-impl-enum-fix, r=lcnr
diagnostics: suggest deriving Default for enums

Fixing outdated code: now we can derive Default for enums

r? @lcnr
2026-01-22 20:42:10 +01:00
enthropy7
b97036628f
Fix ICE when using zero-length SIMD type in extern static
Previously, using a zero-length SIMD type in an extern static would
cause an internal compiler error. Now it properly emits a diagnostic
error instead of panicking.
2026-01-22 21:16:34 +03:00
bors
39052daf93 Auto merge of #149440 - chenyukang:yukang/issue-149402, r=fee1-dead
Remove suggestion from importing unstable items on stable channel

Fixes rust-lang/rust#149402
2026-01-22 18:09:51 +00:00
Bodhi Silberling
8aa5d5aab7 Fix typo: 'recieve' -> 'receive' in lldb-visualizers.md 2026-01-22 09:01:30 -08: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
Islam-Imad
c84eced40b Add test for libc opendir and closedir 2026-01-22 13:22:54 +02: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
Ralf Jung
b22c2f9a12
Merge pull request #4806 from CraftSpider/comp-sig
Compile-time variant of shim_sig_arg
2026-01-22 07:53:35 +00: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
Rune Tynan
a378a5699b Compile-time variant of shim_sig_arg 2026-01-21 19:49:07 -08: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