Commit graph

22295 commits

Author SHA1 Message Date
Esteban Küber
60b227accc Recognize type Alias = dyn Trait in fn return types
```
error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
  --> $DIR/dyn-trait-type-alias-return-type.rs:4:11
   |
LL | fn f() -> T { loop {} }
   |           ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
note: this type alias is unsized
  --> $DIR/dyn-trait-type-alias-return-type.rs:1:1
   |
LL | type T = dyn core::fmt::Debug;
   | ^^^^^^
   = note: the return type of a function must have a statically known size
```
2025-12-09 16:46:33 +00:00
Matthias Krüger
2b0262c199
Rollup merge of #149754 - jieyouxu:compiletest-cli, r=Zalathar
Retire `opt_str2` from compiletest cli parsing

We have `Option<..>`, we don't need to invent "(none)" as option-at-home.

- More specifically, when some test suite expect certain values to be present, they should `.expect(..)` the value, and not potentially receive some "(none)" in some cases.

r? Zalathar
2025-12-09 06:17:25 +01:00
bors
0b96731cd1 Auto merge of #149776 - bjorn3:sync_cg_clif-2025-12-08, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The main highlights this time are a Cranelift update and adding actual support for `-Cdebuginfo=line-tables-only` rather than treating it the same as `-Cdebuginfo=full`.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2025-12-08 22:35:48 +00:00
bors
37aa2135b5 Auto merge of #149766 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 5e3e9c4e61.

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

r? `@ghost`
2025-12-08 19:24:45 +00:00
bjorn3
cb49fe5854 Update list of allowed cg_clif dependencies 2025-12-08 16:26:26 +00:00
Jieyou Xu
72541e9a51
compiletest: retire opt_str2
We either have the value of a flag specified, or we don't. Use
`Option<...>` to represent that -- don't invent a new "(none)" sentinel
value...
2025-12-08 17:44:02 +08:00
Jieyou Xu
a7ad2142e3
compiletest: make presence/absence of adb-related options clear
Instead of possibly falling back to "(none)" when they are not
specified.
2025-12-08 17:44:02 +08:00
Jieyou Xu
260b1ffc2c
compiletest: require host/target flags specified
Instead of allowing them to be missing and using some placeholder
"(none)" value instead.
2025-12-08 17:44:01 +08:00
Stuart Cook
fa9a8f45fc
Rollup merge of #149710 - Zalathar:ambient-gdb, r=jieyouxu
Move ambient gdb discovery from compiletest to bootstrap

- Follow-up to https://github.com/rust-lang/rust/pull/148099

---

This code takes the compiletest code for discovering an “ambient” `gdb` in the user's path, and moves it to bootstrap.

One of the eventual goals is to allow compiletest to assume that if it has been asked to run the debuginfo-gdb suite, then it *must* have been passed an explicit `--gdb`, though we aren't quite there yet.

r? jieyouxu
2025-12-08 11:46:24 +11:00
Stuart Cook
a76db5581b
Rollup merge of #149676 - reddevilmidzy:t10, r=Kivooeo
Tidying up tests/ui/issues tests [3/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895

r? Kivooeo
2025-12-08 11:46:23 +11:00
bors
ba2142a19c Auto merge of #149517 - WaffleLapkin:alphabet-blessing, r=jdonszelmann
Implement blessing for tidy alphabetical check

r? `@jdonszelmann`
2025-12-07 20:08:33 +00:00
Lukas Wirth
632acd7247
Merge pull request #21222 from A4-Tacks/no-comp-resugar-unit-ret-ty
No complete unit RetType in resugar async assoc item
2025-12-07 15:06:49 +00:00
Lukas Wirth
34c61d1a72 fix: Disable postcard use temporarily 2025-12-07 14:52:10 +01:00
A4-Tacks
89a8142571
No complete unit RetType in resugar async assoc item
Example
---
```rust
use core::future::Future;

trait DesugaredAsyncTrait {
    fn foo(&self) -> impl Future<Output = ()> + Send;
}

impl DesugaredAsyncTrait for () {
    $0
}
```

**Before this PR**

```rust
use core::future::Future;

trait DesugaredAsyncTrait {
    fn foo(&self) -> impl Future<Output = ()> + Send;
}

impl DesugaredAsyncTrait for () {
    async fn foo(&self) -> () {
        $0
    }
}
```

**After this PR**

```rust
use core::future::Future;

trait DesugaredAsyncTrait {
    fn foo(&self) -> impl Future<Output = ()> + Send;
}

impl DesugaredAsyncTrait for () {
    async fn foo(&self) {
        $0
    }
}
```
2025-12-07 21:18:40 +08:00
Waffle Lapkin
3bbd6ea19a
attempt to fix tidyselftest on windows 2025-12-07 13:58:35 +01:00
Waffle Lapkin
87f9ea206e
add tests for tidy alphabetical blessing 2025-12-07 13:58:35 +01:00
Lukas Wirth
9f9c9c3845
Merge pull request #21178 from Veykril/tracked-modules
internal: Make `ModuleId` a tracked struct
2025-12-07 08:41:04 +00:00
Lukas Wirth
a1a9514f6f Turn BlockLoc into a tracked struct 2025-12-07 09:31:53 +01:00
Lukas Wirth
7766ee6869 Make ModuleId a tracked struct
optimize some stuff

Optimize `pub(crate)` visibility resolution

Optimize private visibility resolution
2025-12-07 09:31:19 +01:00
Lukas Wirth
ed043f4813
Merge pull request #21215 from ChayimFriedman2/unsized-struct
fix: Don't implement sizedness check via `all_field_tys()`
2025-12-07 08:30:54 +00:00
Matthias Krüger
842f95de70
Rollup merge of #147136 - Jules-Bertholet:const-_-unused-vis, r=jdonszelmann
Add warn-by-default lint for visibility on `const _` declarations

Add a warn-by-default `unused_visibilities` lint for visibility qualifiers on `const _` declarations—e.g. `pub const _: () = ();`. Such qualifiers have no effect.

A [Sourcegraph search](https://sourcegraph.com/search?q=context:global+lang:Rust+pub%5Cs*%28%5C%28.*%5C%29%29%3F%5Cs*const%5Cs%2B_%5Cs*:&patternType=regexp&case=yes&sm=0) suggests that this pattern is relatively rare, and mostly found in tests (with only 3 exceptions). So perhaps this could become an FCW/hard error in the future.

`@rustbot` label T-lang A-lints A-visibility -T-clippy
2025-12-07 08:26:49 +01:00
Zalathar
8f35bd17cc Move ambient gdb discovery from compiletest to bootstrap 2025-12-07 13:44:25 +11:00
Chayim Refael Friedman
aafe60d12f
Merge pull request #21218 from ChayimFriedman2/update-supported-version
internal: Update supported Rust version to 1.90.0
2025-12-07 00:24:54 +00:00
Chayim Refael Friedman
e9d18d5b60 Update supported Rust version to 1.90.0
We no longer work properly with older versions.
2025-12-07 02:14:39 +02:00
bors
d427ddfe90 Auto merge of #149717 - matthiaskrgr:rollup-spntobh, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#149659 (Look for typos when reporting an unknown nightly feature)
 - rust-lang/rust#149699 (Implement `Vec::from_fn`)
 - rust-lang/rust#149700 (rustdoc: fix bugs with search aliases and merging)
 - rust-lang/rust#149713 (Update windows-gnullvm platform support doc)
 - rust-lang/rust#149716 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-06 21:42:15 +00:00
Chayim Refael Friedman
74734878c8 Don't implement sizedness check via all_field_tys()
Since we don't implement it currently for perf reasons, but here we only need a struct's tail field, it will be wrong.
2025-12-06 21:23:21 +02:00
Jules Bertholet
234df83fe3
Add warn-by-default lint for visibility on const _ declarations
Add a warn-by-default `unused_visibility` lint for visibility qualifiers
on `const _` declarations - e.g. `pub const _: () = ();`.
These have no effect.
2025-12-06 13:48:58 -05:00
Ralf Jung
5339794101
Merge pull request #4747 from RalfJung/empty-stack-error
show span when there is an error invoking a global ctor/dtor or the thread main fn
2025-12-06 14:34:52 +00:00
Ralf Jung
7ad3301e03 show span when there is an error invoking a global ctor/dtor or the thread main fn 2025-12-06 15:11:52 +01:00
Ralf Jung
73f124e7ea
Merge pull request #4739 from royAmmerschuber/feature/refactor-tree-visitor
Move `TreeVisitor` into its own file & make it generic.
2025-12-06 13:53:41 +00:00
Ralf Jung
a26b26ac6f cleanup: the *64 functions are Linux-specific 2025-12-06 12:39:30 +01:00
Ralf Jung
44aaae38ac remove readdir_r on FreeBSD: it is deprecated, unused, and untested 2025-12-06 12:38:39 +01:00
Ralf Jung
8b9d1d7d80 use correct stat type and fix some redundancy 2025-12-06 11:29:33 +01:00
hulxv
1647f44955 feat: Support fstat in linux
refactor: rename `macos_fbsd_solarish_write_stat_buf` to `write_stat_buf`

refactor: rename `macos_fbsd_solarish_fstat` to `fstat`

feat: support `fstat` in linux

test: testing support of `fstat` in linux

fix: missed add `Os::Linux` for supported OSs in `fstat`

feat: add nanosecond fields to file metadata in `EvalContextExtPrivate`

add `fstat` to foreign items in unix

enhance test of `fstat`

fix the test
2025-12-06 11:15:53 +01:00
Ralf Jung
77825a2643 ubuntu riscv64 is broken even with extensive retries 2025-12-06 10:15:15 +01:00
Matthias Krüger
8a6f82efac
Rollup merge of #148814 - bend-n:stabilize_array_windows, r=scottmcm
stabilize `array_windows`

Tracking issue: rust-lang/rust#75027
Closes: rust-lang/rust#75027
FCP completed: https://github.com/rust-lang/rust/issues/75027#issuecomment-3477510526
2025-12-06 09:57:59 +01:00
The Miri Cronjob Bot
741862c2db Merge ref '36b2369c91' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 36b2369c91
Filtered ref: bfd8fa706619d2bc17bcfcbed3e76285bb51a2a4
Upstream diff: 864339abf9...36b2369c91

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-06 05:01:32 +00:00
The Miri Cronjob Bot
de3100e560 Prepare for merging from rust-lang/rust
This updates the rust-version file to 36b2369c91.
2025-12-06 04:53:34 +00:00
bors
36b2369c91 Auto merge of #141980 - beetrees:va-list-proposal, r=workingjubilee
`c_variadic`: make `VaList` abi-compatible with C

tracking issue: https://github.com/rust-lang/rust/issues/44930
related PR: rust-lang/rust#144529

On some platforms, the C `va_list` type is actually a single-element array of a struct (on other platforms it is just a pointer). In C, arrays passed as function arguments expirience array-to-pointer decay, which means that C will pass a pointer to the array in the caller instead of the array itself, and modifications to the array in the callee will be visible to the caller (this does not match Rust by-value semantics). However, for `va_list`, the C standard explicitly states that it is undefined behaviour to use a `va_list` after it has been passed by value to a function (in Rust parlance, the `va_list` is moved, not copied). This matches Rust's pass-by-value semantics, meaning that when the C `va_list` type is a single-element array of a struct, the ABI will match C as long as the Rust type is always be passed indirectly.

In the old implementation, this ABI was achieved by having two separate types: `VaList` was the type that needed to be used when passing a `VaList` as a function parameter, whereas `VaListImpl` was the actual `va_list` type that was correct everywhere else. This however is quite confusing, as there are lots of footguns: it is easy to cause bugs by mixing them up (e.g. the C function `void foo(va_list va)` was equivalent to the Rust `fn foo(va: VaList)` whereas the C function `void bar(va_list* va)` was equivalent to the Rust `fn foo(va: *mut VaListImpl)`, not `fn foo(va: *mut VaList)` as might be expected); also converting from `VaListImpl` to `VaList` with `as_va_list()` had platform specific behaviour: on single-element array of a struct platforms it would return a `VaList` referencing the original `VaListImpl`, whereas on other platforms it would return a cioy,

In this PR, there is now just a single `VaList` type (renamed from `VaListImpl`) which represents the C `va_list` type and will just work in all positions. Instead of having a separate type just to make the ABI work, rust-lang/rust#144529 adds a `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute, which when applied to a struct will force the struct to be passed indirectly by non-Rustic calling conventions. This PR then implements the `VaList` rework, making use of the new attribute on all platforms where the C `va_list` type is a single-element array of a struct.

Cleanup of the `VaList` API and implementation is also included in this PR: since it was decided it was OK to experiment with Rust requiring that not calling `va_end` is not undefined behaviour (https://github.com/rust-lang/rust/issues/141524#issuecomment-3028383594), I've removed the `with_copy` method as it was redundant to the `Clone` impl (the `Drop` impl of `VaList` is a no-op as `va_end` is a no-op on all known platforms).

Previous discussion: rust-lang/rust#141524 and [t-compiler > c_variadic API and ABI](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/c_variadic.20API.20and.20ABI)
Tracking issue: https://github.com/rust-lang/rust/issues/44930
r? `@joshtriplett`
2025-12-05 23:36:55 +00:00
Matthias Krüger
a43b30c113
Rollup merge of #149671 - RalfJung:interpret-float-min-max, r=mati865
interpret: test SNaN handling of float min/max and update comments

Also see https://github.com/rust-lang/rust/pull/149563.

I also renamed these enum variants so they are not almost identical.
2025-12-05 16:17:13 +01:00
Matthias Krüger
8e46521d0e
Rollup merge of #149666 - Zalathar:backend-has-zstd, r=jieyouxu
Add perma-unstable `--print=backend-has-zstd` for use by compiletest

Tests for `-Zdebuginfo-compression=zstd` need to be skipped if LLVM was built without support for zstd compression.

Currently, compiletest relies on messy and fragile heuristics to detect whether the compiler's LLVM was built with zstd support. But the compiler itself already knows whether LLVM has zstd or not, so it's easier for compiletest to just ask the compiler.

---

Originally I was intending for this to be a `--print=debuginfo-compression` flag that would print out a list of values supported by `-Zdebuginfo-compression=`. I got that working locally, but it was more complex than I was happy with (in both rustc and compiletest), so I decided to cut scope and instead add a very narrow perma-unstable print request instead.

There is always a circularity hazard whenever we ask the compiler-under-test for information about how to test it. But in this case, the underlying compiler code is fairly simple, whereas the previous heuristics were inherently messy and unreliable anyway.
2025-12-05 16:17:12 +01:00
bors
97b131c900 Auto merge of #148602 - BoxyUwU:coercion_cleanup_uncontroversial, r=lcnr
misc coercion cleanups and handle safety correctly

r? lcnr

### "remove normalize call"

Fixes rust-lang/rust#132765

If the normalization fails we would sometimes get a `TypeError` containing inference variables created inside of the probe used by coercion. These would then get leaked out causing ICEs in diagnostics logic

### "leak check and lub for closure<->closure coerce-lubs of same defids"

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/233
```rust
fn peculiar() -> impl Fn(u8) -> u8 {
    return |x| x + 1
}
```
the `|x| x + 1` expr has a type of `Closure(?31t)` which we wind up inferring the RPIT to. The `CoerceMany` `ret_coercion` for the whole `peculiar` typeck has an expected type of `RPIT` (unnormalized). When we type check the `return |x| x + 1` expr we go from the never type to `Closure(?31t)` which then participates in the `ret_coercion` giving us a `coerce-lub(RPIT, Closure(?31t))`.

Normalizing `RPIT` gives us some `Closure(?50t)` where `?31t` and `?50t` have been unified with `?31t` as the root var. `resolve_vars_if_possible` doesn't resolve infer vars to their roots so these wind up with different structural identities so the fast path doesn't apply and we fall back to coercing to a `fn` ptr. cc rust-lang/rust#147193 which also fixes this

New solver probably just gets more inference variables here because canonicalization + generally different approach to normalization of opaques. Idk :3

### FCP worthy stuffy

there are some other FCP worthy things but they're in my FCP comment which also contains some analysis of the breaking nature of the previously listed changes in this PR: https://github.com/rust-lang/rust/pull/148602#issuecomment-3503497467
2025-12-05 11:46:41 +00:00
reddevilmidzy
c2e43fffbc moved tests 2025-12-05 20:41:51 +09:00
Ralf Jung
f040a1a915 interpret: test SNaN handling of float min/max and update comments 2025-12-05 08:53:42 +01:00
Chayim Refael Friedman
1769b0b680 Handle lint attributes via hir-expand attr handling
This avoids code duplication.
2025-12-05 07:04:18 +02:00
The Miri Cronjob Bot
6661762fd4 Merge ref '864339abf9' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 864339abf9
Filtered ref: f6ad94b050ea0db6b49b3fd3faa6a49504fb4a50
Upstream diff: 3ff30e7eaf...864339abf9

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-05 05:04:00 +00:00
The Miri Cronjob Bot
66e9c33dcb Prepare for merging from rust-lang/rust
This updates the rust-version file to 864339abf9.
2025-12-05 04:56:09 +00:00
Zalathar
84ff44c749 Add perma-unstable --print=backend-has-zstd for use by compiletest
Tests for `-Zdebuginfo-compression=zstd` need to be skipped if LLVM was built
without support for zstd compression.

Currently, compiletest relies on messy and fragile heuristics to detect whether
the compiler's LLVM was built with zstd support. But the compiler itself
already knows whether LLVM has zstd or not, so it's easier for compiletest to
just ask the compiler.
2025-12-05 14:27:52 +11:00
bors
864339abf9 Auto merge of #149653 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac
2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000
- fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915)
- Remove legacy tmpdir support (rust-lang/cargo#16342)
- Run clippy CI on more targets (rust-lang/cargo#16340)
- feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309)
- fix(timings): unlocked -&gt; unblocked (rust-lang/cargo#16337)
- fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335)
- fix(frontmatter): Restrict code fence length  (rust-lang/cargo#16334)
- Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333)
- fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331)

This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
2025-12-05 01:24:59 +00:00
bors
3e2dbcdd3a Auto merge of #149646 - matthiaskrgr:rollup-jbfeow8, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#147224 (Emscripten: Turn wasm-eh on by default)
 - rust-lang/rust#149405 (Recover on misspelled item keyword)
 - rust-lang/rust#149443 (Tidying up UI tests [6/N])
 - rust-lang/rust#149524 (Move attribute safety checking to attribute parsing)
 - rust-lang/rust#149593 (powf, powi: point out SNaN non-determinism)
 - rust-lang/rust#149605 (Use branch name instead of HEAD when unshallowing)
 - rust-lang/rust#149612 (Apply the `bors` environment also to the `outcome` job)
 - rust-lang/rust#149623 (Don't require a normal tool build of clippy/rustfmt when running their test steps)
 - rust-lang/rust#149627 (Point to the item that is incorrectly annotated with `#[diagnostic::on_const]`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-04 22:04:03 +00:00