Commit graph

312834 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
Esteban Küber
fabf5746a2 Add test for type Alias = dyn Trait in return type 2025-12-09 16:46:33 +00:00
Esteban Küber
7868d20bd5 Account for async fn with dyn Trait return type in impl Trait suggestion 2025-12-09 16:46:33 +00:00
Esteban Küber
76f02cf142 Add test for dyn Trait in async fn return type 2025-12-09 16:46:33 +00:00
Esteban Küber
20fabb48b9 Use return type Span on async fns instead of whole fn def Span 2025-12-09 16:46:33 +00:00
bors
e2893f7c95 Auto merge of #149757 - jdonszelmann:revert-duplicate-span-lowering, r=nnethercote
Revert "early return on duplicate span lowerings"

r? `@nnethercote`

reverts rust-lang/rust#149060 because of perf regressions that are still wild to me
2025-12-09 11:38:27 +00:00
bors
d5525a7300 Auto merge of #149798 - matthiaskrgr:rollup-wjgs9x6, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#147585 (Suppress the error for private fields with non_exhaustive attribute)
 - rust-lang/rust#149215 (Emit `check-cfg` lints during attribute parsing rather than evaluation)
 - rust-lang/rust#149652 (Add release notes for 1.92.0)
 - rust-lang/rust#149720 (rustdoc book: mention inner doc attribute)
 - rust-lang/rust#149730 (lint: emit proper diagnostic for unsafe binders in improper_ctypes instead of ICE)
 - rust-lang/rust#149754 (Retire `opt_str2` from compiletest cli parsing)
 - rust-lang/rust#149755 (bootstrap: Use a `CompiletestMode` enum instead of bare strings)
 - rust-lang/rust#149763 (Add inline attribute to generated delegation function if needed)
 - rust-lang/rust#149772 (test: Add a test for 146133)
 - rust-lang/rust#149779 (Fix typo "an" → "and")
 - rust-lang/rust#149782 (Remove `[no-mentions]` handler in the triagebot config)

Failed merges:

 - rust-lang/rust#148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-09 08:20:51 +00:00
Matthias Krüger
288e97018a
Rollup merge of #149782 - Urgau:triagebot-remove-no-mentions, r=Kobzol
Remove `[no-mentions]` handler in the triagebot config

This PR removes the `[no-mentions]` handler in the triagebot config as [GitHub is removing notifications for ``@-mentions`` in commit messages on December 8th 2025.](https://github.blog/changelog/2025-11-07-removing-notifications-for-mentions-in-commit-messages/)

cf. https://github.com/rust-lang/triagebot/issues/2225
2025-12-09 06:17:28 +01:00
Matthias Krüger
2fffbb5f0c
Rollup merge of #149779 - tbu-:pr_an_false, r=joboet
Fix typo "an" → "and"
2025-12-09 06:17:27 +01:00
Matthias Krüger
c77068137d
Rollup merge of #149772 - dianqk:no-builtins-linker-plugin-lto, r=jieyouxu
test: Add a test for 146133

This is a test without using `-Zbuild-std` for https://github.com/rust-lang/rust/pull/146133. There is another test using `-Zbuild-std`: https://github.com/rust-lang/cargo/pull/16277.

Even if a crate is marked as `#![no_builtins]`, we can still generate bitcode for rlib, but we cannot emit bitcode to the linker in rustc's LTO.
2025-12-09 06:17:27 +01:00
Matthias Krüger
7c9c7ed5be
Rollup merge of #149763 - aerooneqq:add-inline-attribute, r=petrochenkov
Add inline attribute to generated delegation function if needed

This PR adds a functionality to add #[inline(always)] attribute to generated functions from delegation, if some #[inline(..)] attribute is already specified on the delegation then we do nothing. This PR is a part of the delegation feature rust-lang/rust#118212 and addresses `Add implicit #[inline] unless specified otherwise` item.

r? ``@petrochenkov``
2025-12-09 06:17:26 +01:00
Matthias Krüger
b13a25377d
Rollup merge of #149755 - Zalathar:test-mode, r=jieyouxu
bootstrap: Use a `CompiletestMode` enum instead of bare strings

This gives better static checking when dealing with compiletest modes in bootstrap, especially for those modes that overlap with the name of a test suite directory.

r? jieyouxu (or bootstrap)
2025-12-09 06:17:25 +01: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
Matthias Krüger
add772d3c4
Rollup merge of #149730 - SATVIKsynopsis:main, r=Kivooeo
lint: emit proper diagnostic for unsafe binders in improper_ctypes instead of ICE

Fixes rust-lang/rust#149719

This PR replaces the `todo!("FIXME(unsafe_binder)")` branch in the `improper_ctypes` lint with a proper diagnostic.

Previously, using an unsafe binder inside an extern `"C"` block caused an internal compiler error.
This fix now ensures that the compiler now emits a clear and stable error message explaining that types containing unsafe binders are not yet supported in FFI.

A new UI test `(unsafe-binder-basic.rs)` is included to ensure this behavior remains stable and prevent regressions.
2025-12-09 06:17:24 +01:00
Matthias Krüger
c4778dcc39
Rollup merge of #149720 - jtracey:patch-1, r=notriddle
rustdoc book: mention inner doc attribute

Couldn't find this documented anywhere else.
2025-12-09 06:17:23 +01:00
Matthias Krüger
990b6630cb
Rollup merge of #149652 - cuviper:relnotes-1.92.0, r=BoxyUwU
Add release notes for 1.92.0

cc ``@rust-lang/release``
r? ``@BoxyUwU``
2025-12-09 06:17:23 +01:00
Matthias Krüger
ece99775da
Rollup merge of #149215 - JonathanBrouwer:cfg_lints2, r=jdonszelmann
Emit `check-cfg` lints during attribute parsing rather than evaluation

The goal of this PR is to make the `eval_config_entry` not have any side effects, by moving the check-cfg lints to the attribute parsing. This also helps ensure we do emit the lint in situations where the attribute happens to be parsed, but never evaluated.

cc ``@jdonszelmann`` ``@Urgau`` for a vibe check if you feel like it
2025-12-09 06:17:22 +01:00
Matthias Krüger
3c19acc607
Rollup merge of #147585 - chenyukang:yukang-fix-147513-suppress-private-fields, r=Kivooeo
Suppress the error for private fields with non_exhaustive attribute

Fixes rust-lang/rust#147513
2025-12-09 06:17:21 +01:00
bors
018d26972e Auto merge of #147572 - alexcrichton:wasi-use-libc, r=Mark-Simulacrum
std: Use more `unix.rs` code on WASI targets

This commit is a large change to the implementation of filesystem and
other system-related operations on WASI targets. Previously the standard
library explicitly used the `wasi` crate at the 0.11.x version track
which means that it used WASIp1 APIs directly. This meant that `std` was
hard-coded to use WASIp1 syscalls and there was no separate
implementation for the WASIp{2,3} targets, for example. The high-level
goal of this commit is to decouple this interaction and avoid the use of
the `wasi` crate on the WASIp2 target.

Historically when WASIp1 was originally added to Rust the wasi-libc
library was in a much different position than it is today. Nowadays Rust
already depends on wasi-libc on WASI targets for things like memory
allocation and environment variable management. As a libc library it
also has all the functions necessary to implement all filesystem
operations Rust wants. Recently wasi-libc additionally was updated to
use WASIp2 APIs directly on the `wasm32-wasip2` target instead of using
`wasm32-wasip1` APIs. This commit is leveraging this work by enabling
Rust to completely sever the dependence on WASIp1 APIs when compiling
for `wasm32-wasip2`. This is also intended to make it easier to migrate
to `wasm32-wasip3` internally in the future where now only libc need be
updated and Rust doesn't need to explicitly change as well.

The overall premise of this commit is that there's no need for
WASI-specific implementation modules throughout the standard library.
Instead the libc-style bindings already implemented for Unix-like
targets are sufficient. This means that Rust will now be using
libc-style interfaces to interact with the filesystem, for example, and
wasi-libc is the one responsible for translating these POSIX-ish
functions into WASIp{1,2} calls.

Concrete changes here are:

* `std` for `wasm32-wasip2` no longer depends on `wasi 0.11.x`
* The implementation of `std::os::wasi::fs`, which was previously
  unstable and still is, now has portions gated to only work on the
  WASIp1 target which use the `wasi` crate directly. Traits have been
  trimmed down in some cases, updated in others, or now present a
  different API on WASIp1 and WASIp2. It's expected this'll get further
  cleanup in the future.
* The `std::sys::fd::wasi` module is deleted and `unix` is used instead.
* The `std::sys::fs::wasi` module is deleted and `unix` is used instead.
* The `std::sys::io::io_slice::wasi` module is deleted and `unix` is used
  instead.
* The `std::sys::pal::{wasip1,wasip2}` modules are now merged together
  as their difference is much smaller than before.
* The `std::sys::pal::wasi::time` is deleted and the `unix` variant is
  used directly instead.
* The `std::sys::stdio::wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.
* The `std::sys:🧵:wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.

Overall Rust's libstd is effectively more tightly bound to libc when
compiled to WASI targets. This is intended to mirror how it's expected
all other languages will also bind to WASI. This additionally has the
nice goal of drastically reducing the WASI-specific maintenance burden
in libstd (in theory) and the only real changes required here are extra
definitions being added to `libc` (done in separate PRs). This might be
required for more symbols in the future but for now everything should be
mostly complete.
2025-12-09 05:10:32 +00:00
bors
a371038013 Auto merge of #149426 - antoyo:libgccjit-targets, r=Kobzol
Move the libgccjit.so file in a target directory

Since GCC is not multi-target, we need multiple libgccjit.so. Our solution to have a directory per target so that we can have multiple libgccjit.so.

r? `@Kobzol`
2025-12-09 01:58:46 +00: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
Josh Stone
90d2477e4e Add release notes for 1.92.0 2025-12-08 13:48:47 -08: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
5a1936fd3f Revert build_llvm_sysroot_for_triple back from reading the manifest to filtering
Reading the manifest doesn't work when running in the context of the
rust build system.
2025-12-08 19:11:10 +00:00
Urgau
b8581ddecc
Remove [no-mentions] handler in the triagebot config
https://github.blog/changelog/2025-11-07-removing-notifications-for-mentions-in-commit-messages/
2025-12-08 19:34:19 +01:00
Tobias Bucher
27a4aabffc Fix typo "an" → "and" 2025-12-08 18:52:46 +01:00
aerooneqq
8cf942d89f Add inline attribute to generated delegation function if needed 2025-12-08 19:56:47 +03:00
bjorn3
cb49fe5854 Update list of allowed cg_clif dependencies 2025-12-08 16:26:26 +00:00
bjorn3
d7e4f9c5ff Merge commit 'e24f0fa3c5' into sync_cg_clif-2025-12-08 2025-12-08 16:20:48 +00:00
Alex Crichton
ba462864f1 std: Use more unix.rs code on WASI targets
This commit is a large change to the implementation of filesystem and
other system-related operations on WASI targets. Previously the standard
library explicitly used the `wasi` crate at the 0.11.x version track
which means that it used WASIp1 APIs directly. This meant that `std` was
hard-coded to use WASIp1 syscalls and there was no separate
implementation for the WASIp{2,3} targets, for example. The high-level
goal of this commit is to decouple this interaction and avoid the use of
the `wasi` crate on the WASIp2 target.

Historically when WASIp1 was originally added to Rust the wasi-libc
library was in a much different position than it is today. Nowadays Rust
already depends on wasi-libc on WASI targets for things like memory
allocation and environment variable management. As a libc library it
also has all the functions necessary to implement all filesystem
operations Rust wants. Recently wasi-libc additionally was updated to
use WASIp2 APIs directly on the `wasm32-wasip2` target instead of using
`wasm32-wasip1` APIs. This commit is leveraging this work by enabling
Rust to completely sever the dependence on WASIp1 APIs when compiling
for `wasm32-wasip2`. This is also intended to make it easier to migrate
to `wasm32-wasip3` internally in the future where now only libc need be
updated and Rust doesn't need to explicitly change as well.

The overall premise of this commit is that there's no need for
WASI-specific implementation modules throughout the standard library.
Instead the libc-style bindings already implemented for Unix-like
targets are sufficient. This means that Rust will now be using
libc-style interfaces to interact with the filesystem, for example, and
wasi-libc is the one responsible for translating these POSIX-ish
functions into WASIp{1,2} calls.

Concrete changes here are:

* `std` for `wasm32-wasip2` no longer depends on `wasi 0.11.x`
* The implementation of `std::os::wasi::fs`, which was previously
  unstable and still is, now has portions gated to only work on the
  WASIp1 target which use the `wasi` crate directly. Traits have been
  trimmed down in some cases, updated in others, or now present a
  different API on WASIp1 and WASIp2. It's expected this'll get further
  cleanup in the future.
* The `std::sys::fd::wasi` module is deleted and `unix` is used instead.
* The `std::sys::fs::wasi` module is deleted and `unix` is used instead.
* The `std::sys::io::io_slice::wasi` module is deleted and `unix` is used
  instead.
* The `std::sys::pal::{wasip1,wasip2}` modules are now merged together
  as their difference is much smaller than before.
* The `std::sys::pal::wasi::time` is deleted and the `unix` variant is
  used directly instead.
* The `std::sys::stdio::wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.
* The `std::sys:🧵:wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.

Overall Rust's libstd is effectively more tightly bound to libc when
compiled to WASI targets. This is intended to mirror how it's expected
all other languages will also bind to WASI. This additionally has the
nice goal of drastically reducing the WASI-specific maintenance burden
in libstd (in theory) and the only real changes required here are extra
definitions being added to `libc` (done in separate PRs). This might be
required for more symbols in the future but for now everything should be
mostly complete.
2025-12-08 06:46:28 -08:00
dianqk
611c956c78
test: Add test for 146133
Even if a crate is marked as #![no_builtins], we can still generate bitcode for rlib,
but we cannot emit bitcode to the linker in rustc's LTO.
2025-12-08 21:57:17 +08:00
SATVIKsynopsis
0f4ec28155 lint: treat unsafe binders in improper_ctypes instead of ICE
Replaced _binder with _
2025-12-08 18:51:59 +05:30
bjorn3
e24f0fa3c5 Update dependencies 2025-12-08 11:20:15 +00:00
bjorn3
154e158a47
Merge pull request #1609 from rust-lang/line_table_only_debuginfo
Only generate line tables with -Cdebuginfo=line-table-only
2025-12-08 11:38:14 +01:00
Zalathar
dc8cdb1c00 Use a CompiletestMode enum in bootstrap 2025-12-08 21:35:58 +11:00
Zalathar
8c582e1f53 Don't require test::Coverage to implement Ord
This derive was an artifact of test-only method `Cache::all` wanting to
automatically sort its output to hide HashMap iteration order.

We can achieve an equivalent result by requiring the caller to provide a
projection function that returns results that _are_ sortable.
2025-12-08 21:35:16 +11:00
bjorn3
8b0e6756e0 Only generate line tables with -Cdebuginfo=line-table-only 2025-12-08 10:22:41 +00:00
bjorn3
ba27d3d8a6 Fix gimli assertion for anonymous sources 2025-12-08 10:22:41 +00:00
bjorn3
fd6e372a97 Fix Cirrus CI 2025-12-08 10:13:25 +00:00
bjorn3
5139ab431f Fix rustc testsuite 2025-12-08 09:55:17 +00:00
Jana Dönszelmann
942a08b559
Revert "early return on duplicate span lowerings"
This reverts commit 0087253015.
2025-12-08 10:49:55 +01:00
bjorn3
29d4cbafa4 Rustup to rustc 1.94.0-nightly (ba2142a19 2025-12-07) 2025-12-08 09:46:16 +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
bors
5bc345055b Auto merge of #149455 - jdonszelmann:metadata-decoding-s, r=WaffleLapkin
Remove unwraps from metadata decoding: introduce `BlobDecoder`

r? `@oli-obk`
2025-12-08 09:41:00 +00:00
bjorn3
b0d62ebccc Sync from rust ba2142a19c 2025-12-08 09:39:20 +00:00
bors
03d7ad7dd6 Auto merge of #149750 - Zalathar:rollup-9qjiz5r, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#148935 (Fix division syntax in doc comments)
 - rust-lang/rust#149207 (Add `ilog10` result range hints)
 - rust-lang/rust#149676 (Tidying up tests/ui/issues tests [3/N])
 - rust-lang/rust#149710 (Move ambient gdb discovery from compiletest to bootstrap)
 - rust-lang/rust#149714 (Check associated type where-clauses for lifetimes)
 - rust-lang/rust#149722 (contracts: fix lowering final declaration without trailing semicolon)
 - rust-lang/rust#149736 (contracts: clean up feature flag warning duplicated across tests)
 - rust-lang/rust#149739 (mailmap: add binarycat)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-08 06:27:26 +00:00
Stuart Cook
2aa4bdcec2
Rollup merge of #149739 - lolbinarycat:mailmap-add-self, r=Kivooeo
mailmap: add binarycat
2025-12-08 11:46:27 +11:00
Stuart Cook
d239114c8a
Rollup merge of #149736 - dawidl022:contracts/chore/cleanup-warning-in-tests, r=Kivooeo,jieyouxu
contracts: clean up feature flag warning duplicated across tests

There is no need for every contracts test to assert the same warning for using the `contracts` feature flag, as such use `#![expect(incomplete_features)]` in the tests, and add one test to specifically check for the warning.

Making this change has been discussed in the comments of rust-lang/rust#149722.

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

r? Kivooeo
2025-12-08 11:46:26 +11:00