305515 Commits

Author SHA1 Message Date
Stuart Cook
c2e8264b34
Rollup merge of #145838 - dianne:non-extending-super-let, r=jackh726,traviscross
don't apply temporary lifetime extension rules to non-extended `super let`

Reference PR: rust-lang/reference#1980

This changes the semantics for `super let` (and macros implemented in terms of it, such as `pin!`, `format_args!`, `write!`, and `println!`) as suggested by ````@theemathas```` in https://github.com/rust-lang/rust/issues/145784#issuecomment-3218658335, making `super let` initializers only count as [extending expressions](https://doc.rust-lang.org/nightly/reference/destructors.html#extending-based-on-expressions) when the `super let` itself is within an extending block. Since `super let` initializers aren't temporary drop scopes, their temporaries outside of inner temporary scopes are effectively always extended, even when not in extending positions; this only affects two cases as far as I can tell:
- Block tail expressions in Rust 2024. This PR makes `f(pin!({ &temp() }))` drop `temp()` at the end of the block in Rust 2024, whereas previously it would live until after the call to `f` because syntactically the `temp()` was in an extending position as a result of `super let` in `pin!`'s expansion.
- `super let` nested within a non-extended `super let` is no longer extended. i.e. a normal `let` is required to treat `super let`s as extending (in which case nested `super let`s will also be extending).

Closes rust-lang/rust#145784

This is a breaking change. Both static and dynamic semantics are affected. The most likely breakage is for programs to stop compiling, but it's technically possible for drop order to silently change as well (as in rust-lang/rust#145784). Since this affects stable macros, it probably would need a crater run.

Nominating for discussion alongside rust-lang/rust#145784: ````@rustbot```` label +I-lang-nominated +I-libs-api-nominated

Tracking issue for `super let`: rust-lang/rust#139076
2025-09-17 14:56:45 +10:00
Stuart Cook
6ad98750e0
Rollup merge of #145660 - jbatez:darwin_objc, r=jdonszelmann,madsmtm,tmandry
initial implementation of the darwin_objc unstable feature

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

This feature makes it possible to reference Objective-C classes and selectors using the same ABI used by native Objective-C on Apple/Darwin platforms. Without it, Rust code interacting with Objective-C must resort to loading classes and selectors using costly string-based lookups at runtime. With it, these references can be loaded efficiently at dynamic load time.

r? ```@tmandry```

try-job: `*apple*`
try-job: `x86_64-gnu-nopt`
2025-09-17 14:56:44 +10:00
Stuart Cook
f21a9c94cf
Rollup merge of #145181 - Borgerr:remove-fixme-from-has-sigdrop, r=lcnr
remove FIXME block from `has_significant_drop`, it never encounters inference variables

The `FIXME` block in `Ty::has_significant_drop` is outdated as related queries can now handle type inference.

321a89bec5/compiler/rustc_middle/src/ty/util.rs (L1378-L1389)

Closes rust-lang/rust#86868 (other places mentioned in the issue have been resolved, or moved to other issues)

r? types
2025-09-17 14:56:43 +10:00
Stuart Cook
f104ecfba6
Rollup merge of #145071 - cuviper:min-llvm-20, r=nikic
Update the minimum external LLVM to 20

With this change, we'll have stable support for LLVM 20 and 21.
For reference, the previous increase to LLVM 19 was rust-lang/rust#139275.

cc ```@rust-lang/wg-llvm```
r? nikic
2025-09-17 14:56:43 +10:00
Stuart Cook
feeb68eb5e
Rollup merge of #144871 - Kivooeo:btree_entry_insert-stabilize, r=jhpratt
Stabilize `btree_entry_insert` feature

This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](https://github.com/rust-lang/rust/issues/65225).

New stable API:

```rust
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
    pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
    pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
```

(FCP ended almost a year ago, so if it's needed for process we could rerun it)

Closes: https://github.com/rust-lang/rust/issues/65225
2025-09-17 14:56:42 +10:00
Stuart Cook
9d93fab3a1
Rollup merge of #142807 - sourcefrog:failfast, r=dtolnay
libtest: expose --fail-fast as an unstable command-line option

This exposes the `fail_fast` option added in rust-lang/rust#105153 on the test harness command line, so that workflows that only want to know if any test fails can find out without waiting for everything to run. For example, cargo-mutants just needs to know if any tests fails. It only works with `-Zunstable-options`.

Tracking issue: rust-lang/rust#142859
2025-09-17 14:56:41 +10:00
bors
3f1552a273 Auto merge of #146650 - matthiaskrgr:rollup-rjrklz9, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146442 (Display ?Sized, const, and lifetime parameters in trait item suggestions across a crate boundary)
 - rust-lang/rust#146474 (Improve `core::ascii` coverage)
 - rust-lang/rust#146605 (Bump rustfix 0.8.1 -> 0.8.7)
 - rust-lang/rust#146611 (bootstrap: emit hint if a config key is used in the wrong section)
 - rust-lang/rust#146618 (Do not run ui test if options specific to LLVM are used when another codegen backend is used)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-16 21:53:05 +00:00
Josh Stone
88bef49646 Update the FIXME comments in the generic three_way_compare 2025-09-16 11:49:21 -07:00
Josh Stone
e54602c5bb Merge similar output checks in assembly-llvm/x86_64-cmp 2025-09-16 11:49:21 -07:00
Josh Stone
580b4891aa Update the minimum external LLVM to 20 2025-09-16 11:49:20 -07:00
bors
a9d0a6f155 Auto merge of #138271 - mu001999-contrib:fix-138234, r=jackh726
Keep space if arg does not follow punctuation when lint unused parens

Fixes rust-lang/rust#138234

If the arg follows punctuation, still pass `left_pos` with `None` and no space will be added, else then pass `left_pos` with `Some(arg.span.lo())`, so that we can add the space as expected.

And `emit_unused_delims` can make sure no more space will be added if the expr follows space.

---

Edited:

Directly use the `value_span` to check whether the expr removed parens will follow identifier or be followed by identifier.
2025-09-16 18:43:49 +00:00
Matthias Krüger
cf035527ac
Rollup merge of #146618 - GuillaumeGomez:backend-run-llvm-options, r=kobzol
Do not run ui test if options specific to LLVM are used when another codegen backend is used

Based on errors in https://github.com/rust-lang/rust/pull/146414, some tests with LLVM-specific options are run when another codegen is actually the one used.

This PR ignores these tests in such cases now to prevent this situation.

r? `@kobzol`
2025-09-16 20:42:24 +02:00
Matthias Krüger
d1ed4f4238
Rollup merge of #146611 - lolbinarycat:bootstrap-toml-wrong-section-diagnostic, r=Kobzol
bootstrap: emit hint if a config key is used in the wrong section

based on discussion on rust-lang/rust#146591

now, if the user puts `build.download-rustc` in `bootstrap.toml`, they'll get a diagnostic:
``hint: try moving `download-rustc` to the `rust` section``

and if they nest things too much (`rust.rust.download-rustc`):
``hint: section name `rust` used as a key within a section``

if they specify a top-level key within a section (`rust.profile`):
``hint: try using `profile` as a top level key``

r? `@Kobzol`
2025-09-16 20:42:24 +02:00
Matthias Krüger
b1a724626b
Rollup merge of #146605 - jyn514:update-rustfix, r=nnethercote
Bump rustfix 0.8.1 -> 0.8.7

This commit can be replicated by running `cargo update -p rustfix --precise 0.8.7 && x test ui --bless`.

---

The reasons this affects UI tests is as follows:
- The UI test suite runs rustc with `-Z deduplicate-diagnostics=no --error-format=json`, which means that rustc emits multiple errors containing identical suggestions. That caused the weird-looking code that had multiple `X: Copy` suggestions.
- Those suggestions are interpreted not by rustc itself, but by the `rustfix` library, maintained by cargo but published as a separate crates.io library and used by compiletest.
- Sometime between rustfix 0.8.1 and 0.8.7 (probably in rust-lang/cargo#14747, but it's hard to tell because rustfix's versioning doesn't match cargo's), rustfix got smarter and stopped applying duplicate suggestions.

Update rustfix to match cargo's behavior. Ideally, we would always share a version of rustfix between cargo and rustc (perhaps with a path dependency?), to make sure we are testing the behavior we ship. But for now, just manually update it to match.

Note that the latest version of rustfix published to crates.io is 0.9.1, not 0.8.7. But 0.9.1 is not the version used in cargo, which is 0.9.3. Rather than trying to match versions exactly, I just updated rustfix to the latest in the 0.8 branch.
2025-09-16 20:42:23 +02:00
Matthias Krüger
f4a522d1f8
Rollup merge of #146474 - ferrocene:pvdrz/improve-ascii-coverage, r=Noratrieb
Improve `core::ascii` coverage

This PR improves the `core::ascii` coverage by adding a new test to `coretests`

r? `@workingjubilee`
2025-09-16 20:42:22 +02:00
Matthias Krüger
a811bb631a
Rollup merge of #146442 - Qelxiros:trait-suggestion-generics, r=BoxyUwU
Display ?Sized, const, and lifetime parameters in trait item suggestions across a crate boundary

context: rust-lang/rust#145929

This fixes the MetaSized issue and adds const generics and early bound lifetimes. Late bound lifetimes are harder because they aren't returned by `generics_of`. I'm going to look into it, but there's no guarantee I'll be successful.

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

r? `@BoxyUwu`
2025-09-16 20:42:22 +02:00
binarycat
9c423796bb bootstrap: emit hint if a config key is used in the wrong section 2025-09-16 12:39:49 -05:00
Guillaume Gomez
a535042e80 Do not run ui test if options specific to llvm are used when another codegen backend is used 2025-09-16 17:47:43 +02:00
Christian Poveda
e652f97c6b
Improve core::ascii coverage 2025-09-16 10:05:40 -05:00
Jeremy Smart
1a1510816a
handle const generics, ?Sized, early bound lifetimes 2025-09-16 10:17:25 -04:00
Mu001999
9991ec282f Keep space if expr follows identifier when lint unused parens 2025-09-16 11:31:59 +00:00
bors
eec6bd9d69 Auto merge of #146516 - cjgillot:dest-prop-aggregate, r=Amanieu
DestinationPropagation: avoid creating overlapping assignments.

r? `@Amanieu`

Fixes https://github.com/rust-lang/rust/issues/146383
2025-09-16 09:18:32 +00:00
bors
8a1b39995e Auto merge of #146614 - Zalathar:rollup-hcxvdi1, r=Zalathar
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#145095 (Migrate `UnsizedConstParamTy`  to unstable impl of `ConstParamTy_`)
 - rust-lang/rust#145960 (Split `FnCtxt::report_args_error` into subfunctions)
 - rust-lang/rust#146402 (interpret: fix overlapping aggregate initialization)
 - rust-lang/rust#146466 (llvm-wrapper: other cleanup)
 - rust-lang/rust#146574 (compiletest: Enable new-output-capture by default)
 - rust-lang/rust#146599 (replace some `#[const_trait]` with `const trait`)
 - rust-lang/rust#146601 (compiletest: Make `./x test --test-args ...` work again)
 - rust-lang/rust#146608 (improve internal bootstrap docs)
 - rust-lang/rust#146609 (bootstrap: lower verbosity of cargo to one less than bootstrap's)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-16 04:26:18 +00:00
Camille Gillot
d58061e613 Restrict simple assignment condition. 2025-09-16 01:22:10 +00:00
Stuart Cook
f0e8c2fb6f
Rollup merge of #146609 - lolbinarycat:bootstrap-less-verbose-cargo, r=Kobzol
bootstrap: lower verbosity of cargo to one less than bootstrap's

the main thing this does is eliminate the "Fresh ..." output when `--verbose` is only passed once.

r? `@Kobzol`
2025-09-16 10:25:44 +10:00
Stuart Cook
cc315a8fba
Rollup merge of #146608 - lolbinarycat:bootstrap-readme, r=Kobzol
improve internal bootstrap docs

Mainly focused on making it easier to figure out how tools get built without having to read the `bootstrap_tool!` macro, but also added some subdirs of `build/` to the readme.
2025-09-16 10:25:43 +10:00
Stuart Cook
7cad097408
Rollup merge of #146601 - Enselic:fix-test-args, r=Mark-Simulacrum
compiletest: Make `./x test --test-args ...` work again

It accidentally broke with  https://github.com/rust-lang/rust/pull/146501. The intention of that PR was to keep existing behavior if `--exact` is not used, but it had a bug. This PR fixes that bug.
2025-09-16 10:25:42 +10:00
Stuart Cook
f3c395b118
Rollup merge of #146599 - npmccallum:cleanup, r=fmease
replace some `#[const_trait]` with `const trait`
2025-09-16 10:25:42 +10:00
Stuart Cook
336e45e041
Rollup merge of #146574 - Zalathar:capture, r=jieyouxu
compiletest: Enable new-output-capture by default

The new output-capture implementation was added in rust-lang/rust#146119, but was disabled by default and required opt-in.

Since then, I haven't encountered any problems in my own testing/usage, and I haven't heard any problem reports from other contributors who might have opted in.

It's unlikely that more opt-in testing will help, so the next step is to enable new-output-capture by default and see if anyone complains. (Hopefully nobody!)

If needed, the new default can be overridden (for now) by setting environment variable `COMPILETEST_NEW_OUTPUT_CAPTURE=off`. Please file an issue (or let me know) if anyone finds a reason to do this.

r? jieyouxu
2025-09-16 10:25:41 +10:00
Stuart Cook
9eaf3c8864
Rollup merge of #146466 - klensy:llvm-wrapper-c, r=cuviper
llvm-wrapper: other cleanup

Cleanup few things around llvm-wrapper:

First commit removes unused macro, added back in https://github.com/rust-lang/rust/pull/31709 it was used in `LLVMRustHasFeature`; second removes unused function, third one removes `jsbackend` llvm component - this is looks like remnants of some removed backend?
2025-09-16 10:25:40 +10:00
Stuart Cook
f162d11351
Rollup merge of #146402 - RalfJung:aggregate-init, r=saethlin
interpret: fix overlapping aggregate initialization

This fixes the problem pointed out by ````@saethlin```` in https://github.com/rust-lang/rust/issues/146383#issuecomment-3273224645.

Also clarify when exactly current de-facto MIR semantics allow overlap of the LHS and RHS in an assignment.
2025-09-16 10:25:40 +10:00
Stuart Cook
85249d5571
Rollup merge of #145960 - scrabsha:push-kskuprrtmnky, r=jdonszelmann
Split `FnCtxt::report_args_error` into subfunctions
2025-09-16 10:25:39 +10:00
Stuart Cook
edd6721583
Rollup merge of #145095 - tiif:unstable_const_param, r=BoxyUwU
Migrate `UnsizedConstParamTy`  to unstable impl of `ConstParamTy_`

Now that we have ``#[unstable_feature_bound]``, we can remove ``UnsizedConstParamTy`` that was meant to be an unstable impl of stable type and ``ConstParamTy_`` trait.

r? `@BoxyUwU`
2025-09-16 10:25:38 +10:00
bors
9d82de19df Auto merge of #146610 - matthiaskrgr:rollup-xkt5kjz, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#146344 (tests/codegen-llvm: Make rust-abi-arch-specific-adjustment portable)
 - rust-lang/rust#146530 (rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber list)
 - rust-lang/rust#146533 (Note some previous attempts to change the Default impl for `[T; 0]`)
 - rust-lang/rust#146539 (fix 404 MCP link)
 - rust-lang/rust#146546 (Switch `std::vec::PeekMut::pop` from self to this parameter.)
 - rust-lang/rust#146549 (On FreeBSD, use readdir instead of readdir_r)
 - rust-lang/rust#146559 (Fix typo in error message)
 - rust-lang/rust#146563 (bootstrap.py: disable incremental build for bootstrap in CI)
 - rust-lang/rust#146576 (opt-dist: don't set `RUST_LOG=collector=debug`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-15 23:12:06 +00:00
Matthias Krüger
8f2b6029f5
Rollup merge of #146576 - ognevny:opt-dist-collector-logs, r=Kobzol
opt-dist: don't set `RUST_LOG=collector=debug`

see https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/opt-dist.3A.20do.20not.20set.20RUST_LOG.3Dcollector.3Ddebug.20forcefully

r? Kobzol
2025-09-15 22:09:52 +02:00
Matthias Krüger
cb9f476314
Rollup merge of #146563 - lolbinarycat:bootstrap-ci-no-incremental, r=Kobzol
bootstrap.py: disable incremental build for bootstrap in CI

locally this seems to save a quarter of a second per build of bootstrap, presumably mainly because it avoids writing 280MB to disk.  unsure if this is worth two extra lines of python, i'll let t-bootstrap decide.
2025-09-15 22:09:51 +02:00
Matthias Krüger
070456bccf
Rollup merge of #146559 - Jules-Bertholet:fix-typo, r=nnethercote
Fix typo in error message
2025-09-15 22:09:50 +02:00
Matthias Krüger
fbd63a93c3
Rollup merge of #146549 - asomers:freebsd-readdir, r=Mark-Simulacrum
On FreeBSD, use readdir instead of readdir_r

readdir_r has the same problems on FreeBSD as it does on other platforms: it assumes a fixed NAME_MAX.  And readdir has the same thread-safety guarantee as it does on other platforms: it's safe as long as only one thread tries to read from the directory stream at a given time.

Furthermore, readdir_r is likely to be removed for FreeBSD 16, so we should stop using it now.
2025-09-15 22:09:50 +02:00
Matthias Krüger
98ab2b0e80
Rollup merge of #146546 - cammeresi:pop, r=Mark-Simulacrum
Switch `std::vec::PeekMut::pop` from self to this parameter.

Since PeekMut implements Deref, it shouldn't have any methods of its own.

See also: `std::collections::binary_heap::PeekMut::pop`
Pointed out: https://github.com/rust-lang/rust/issues/122742#issuecomment-3064050551
Related: rust-lang/rust#122742
2025-09-15 22:09:49 +02:00
Matthias Krüger
1f363a1921
Rollup merge of #146539 - luca3s:push-xuwtvwrsspnp, r=jieyouxu
fix 404 MCP link

I think this is what this should point to.

The old link did a redirect, so one could also fix the redirect, but i wasn't able to find where the redirect target is defined.

Found in https://rust-lang.zulipchat.com/#narrow/channel/242906-t-compiler.2Farm/topic/Tier.20changes.20for.20bare-metal.20Arm.20AArch32.20targets/with/539395822
2025-09-15 22:09:48 +02:00
Matthias Krüger
4950bf5c19
Rollup merge of #146533 - Zalathar:array-default, r=compiler-errors
Note some previous attempts to change the Default impl for `[T; 0]`

Recently, rust-lang/rust#145457 experimented with changing the Default impl for `[T; 0]`.

Subsequently, rust-lang/rust#146531 also aimed to perform a similar experiment.

It seems like a good idea to add some links to the relevant source code, so that the historical context of this tricky topic is easier to find.
2025-09-15 22:09:48 +02:00
Matthias Krüger
f34e30affa
Rollup merge of #146530 - a4lg:riscv-inline-asm-default-clobber-float-flags, r=Amanieu
rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber list

Despite that the `fflags` register (representing floating point exception flags) is stated as a flag register [in the reference](https://doc.rust-lang.org/reference/inline-assembly.html#r-asm.rules.preserved-registers), it's not
in the default clobber list of the RISC-V inline assembly and it would be better to fix it.
2025-09-15 22:09:47 +02:00
Matthias Krüger
bcdb3eeeff
Rollup merge of #146344 - Gelbpunkt:loongarch-codegen-llvm-test, r=Mark-Simulacrum
tests/codegen-llvm: Make rust-abi-arch-specific-adjustment portable

This test currently only runs on RISC-V and loongarch hosts, but assumes that the host target is the -gnu target. By using minicore, we can run this test on all host targets, regardless of architecture, as long as the LLVM components are built.
This also fixes this test on musl hosts of these architectures (though I've only tested on loongarch64-unknown-linux-musl).
2025-09-15 22:09:47 +02:00
bors
a454fccb02 Auto merge of #146405 - BoxyUwU:relnotes_1_90, r=Mark-Simulacrum
Add relnotes for 1.90.0

r? `@Mark-Simulacrum`
cc `@rust-lang/release`
`@rustbot` ping relnotes-interest-group
2025-09-15 20:06:13 +00:00
ash
fa7e474f9c remove FIXME from has_significant_drop, replaced with checking non_region_infer 2025-09-15 13:55:20 -06:00
binarycat
29ca09be09 bootstrap: lower verbosity of cargo to one less than bootstrap's
the main thing this does is eliminate the "Fresh ..." output when
`--verbose` is only passed once.
2025-09-15 14:42:44 -05:00
binarycat
b8cb80cf80 improve internal bootstrap docs 2025-09-15 13:38:04 -05:00
Jynn Nelson
2adaa5dae2 Bump rustfix 0.8.1 -> 0.8.7
This commit can be replicated by running
`cargo update -p rustfix --precise 0.8.7 && x test ui --bless`.

---

The reasons this affects UI tests is as follows:
- The UI test suite runs rustc with
    `-Z deduplicate-diagnostics=no --error-format=json`,
  which means that rustc emits multiple errors containing identical
  suggestions. That caused the weird-looking code that had multiple `X: Copy` suggestions.
- Those suggestions are interpreted not by rustc itself, but by the
  `rustfix` library, maintained by cargo but published as a separate
  crates.io library and used by compiletest.
- Sometime between rustfix 0.8.1 and 0.8.7 (probably in cargo 14747, but
  it's hard to tell because rustfix's versioning doesn't match cargo's),
  rustfix got smarter and stopped applying duplicate suggestions.

Update rustfix to match cargo's behavior. Ideally, we would always share
a version of rustfix between cargo and rustc (perhaps with a path
dependency?), to make sure we are testing the behavior we ship. But for
now, just manually update it to match.

Note that the latest version of rustfix published to crates.io is 0.9.1,
not 0.8.7. But 0.9.1 is not the version used in cargo, which is 0.9.3.
Rather than trying to match versions exactly, I just updated rustfix to
the latest in the 0.8 branch.
2025-09-15 10:48:26 -07:00
Martin Nordholts
bf73aac8cb compiletest: Make ./x test --test-args ... work again
It accidentally broke with a48c8e337d1. The intention of that commit was
to keep existing behavior if `--exact` is not used, but it had a bug.
This commit fixes that bug.
2025-09-15 18:37:47 +02:00
Nathaniel McCallum
2d76bb1f23 replace some #[const_trait] with const trait 2025-09-15 11:33:40 -04:00