Commit graph

163809 commits

Author SHA1 Message Date
Ralf Jung
7ea812fd54 nanosleep: fix argument name and add a missing argument read 2025-07-03 17:48:33 +02:00
Ralf Jung
484c64b161 Merge from rustc 2025-07-03 10:28:08 +02:00
Camille GILLOT
3380bfd1a0 Replace kw_span by full span. 2025-07-03 14:59:27 +00:00
Ralf Jung
2cbbd6c9f5 Preparing for merge from rustc 2025-07-03 10:28:05 +02:00
Ralf Jung
db617afe8b only set host-specific CC; improve and de-duplicate native libs testing logic 2025-07-03 08:40:04 +02:00
Matthias Krüger
bc0262d0f1
Rollup merge of #143327 - RalfJung:miri-type-validity-error, r=oli-obk
miri: improve errors for type validity assertion failures

Miri has pretty nice errors for type validity violations, printing which field in the type the problem occurs at and so on.

However, we don't see these errors when using e.g. `mem::zeroed` as that uses `assert_zero_valid` to bail out before Miri can detect the UB.

Similar to what we did with `@saethlin's` UB checks, I think we should disable such language UB checks in Miri so that we can get better error messages. If we go for this we should probably say this in the intrinsic docs as well so that people don't think they can rely on these intrinsics catching anything.

Furthermore, I slightly changed `MaybeUninit::assume_init` so that the `.value` field does not show up in error messages any more.

`@rust-lang/miri` what do you think?
2025-07-03 05:21:36 +02:00
Matthias Krüger
5aa7dd81d8
Rollup merge of #143325 - Kobzol:bootstrap-interner, r=clubby789
Use non-global interner in `test_string_interning` in bootstrap

Just a small cleanup that we found on our GSoC call.

CC `@Shourya742`
2025-07-03 05:21:36 +02:00
Matthias Krüger
7e600de3c8
Rollup merge of #143324 - RalfJung:native-call-prep, r=oli-obk
interpret: move the native call preparation logic into Miri

`@nia-e` has to do a bunch of changes to this logic for her native call ptrace work, and it's getting annoying that the logic is split between Miri and rustc. So this moves the logic to Miri, keeping just the generic traversal part in rustc. It is unfortunate that this means we have to expose `get_alloc_raw`/`get_alloc_raw_mut`... I hope the function name is scary enough to reduce the risk of misuse.

r? `@oli-obk`
2025-07-03 05:21:35 +02:00
Matthias Krüger
4a3c2fca22
Rollup merge of #143316 - Kobzol:bootstrap-check-tests, r=jieyouxu
Add bootstrap check snapshot tests

Split off from https://github.com/rust-lang/rust/pull/143048, so that we get a baseline of how check behaved before we make changes to it. Note that the output of the check snapshot tests is suboptimal in many places, as we're missing information about stages and the build compiler. That will be changed in https://github.com/rust-lang/rust/pull/143048.

r? `@jieyouxu`
2025-07-03 05:21:34 +02:00
Matthias Krüger
c3e3f43f2a
Rollup merge of #143251 - lolbinarycat:bootstrap-toml-tidy-extra-checks, r=Kobzol
bootstrap: add build.tidy-extra-checks option

split off from rust-lang/rust#142924

r? `@Kobzol`
2025-07-03 05:21:32 +02:00
Matthias Krüger
6d54983ae9
Rollup merge of #143192 - GuillaumeGomez:code-line-number, r=lolbinary
Improve CSS for source code block line numbers

Extract some changes from https://github.com/rust-lang/rust/pull/137229 to make the PR smaller (thanks `@yotamofek` for the suggestion!).

r? notriddle
2025-07-03 05:21:31 +02:00
bors
25face9808 Auto merge of #143338 - matthiaskrgr:rollup-ykaxh04, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#131923 (Derive `Copy` and `Hash` for `IntErrorKind`)
 - rust-lang/rust#138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore)
 - rust-lang/rust#141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`)
 - rust-lang/rust#142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`)
 - rust-lang/rust#142237 (Detect more cases of unused_parens around types)
 - rust-lang/rust#142964 (Attribute rework: a parser for single attributes without arguments)
 - rust-lang/rust#143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself)
 - rust-lang/rust#143235 (Assemble const bounds via normal item bounds in old solver too)
 - rust-lang/rust#143261 (Feed `explicit_predicates_of` instead of `predicates_of`)
 - rust-lang/rust#143276 (loop match: handle opaque patterns)
 - rust-lang/rust#143306 (Add `track_caller` attributes to trace origin of Clippy lints)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: x86_64-gnu
try-job: dist-i586-gnu-i586-i686-musl
try-job: test-various
2025-07-02 23:29:03 +00:00
bors
6677875279 Auto merge of #143337 - matthiaskrgr:rollup-lqwhe0i, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#141847 (Explain `TOCTOU` on the top of `std::fs`, and reference it in functions)
 - rust-lang/rust#142138 (Add `Vec::into_chunks`)
 - rust-lang/rust#142321 (Expose elf abi on ppc64 targets)
 - rust-lang/rust#142886 (ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`)
 - rust-lang/rust#143194 (fix bitcast of single-element SIMD vectors)
 - rust-lang/rust#143231 (Suggest use another lifetime specifier instead of underscore lifetime)
 - rust-lang/rust#143232 ([COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest)
 - rust-lang/rust#143258 (Don't recompute `DisambiguatorState` for every RPITIT in trait definition)
 - rust-lang/rust#143274 (ci: support optional jobs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-02 20:25:23 +00:00
Matthias Krüger
bc8bcc7e8a
Rollup merge of #143306 - samueltardieu:track-clippy-lints-emission, r=petrochenkov
Add `track_caller` attributes to trace origin of Clippy lints

This allows the use of `-Z track-diagnostics` to see the origin of Clippy lints emission, as is already the case for lints coming from rustc.
2025-07-02 19:29:39 +02:00
Matthias Krüger
d50240b471
Rollup merge of #142212 - GrigorenkoPV:codegens, r=Kobzol
bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`

As per https://github.com/rust-lang/rust/issues/142184#issuecomment-2954124009.

Closes rust-lang/rust#142184.
2025-07-02 19:29:35 +02:00
Matthias Krüger
c572231fb9
Rollup merge of #143274 - marcoieni:optional-jobs, r=Kobzol
ci: support optional jobs

try-job: optional-mingw-check-1
2025-07-02 19:28:09 +02:00
Matthias Krüger
df7cac9e03
Rollup merge of #143232 - jieyouxu:compiletest-maintenance-3, r=Kobzol
[COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest

Instead of using *both* "headers" and "directives" within compiletest to refer to the same thing. This of course induces some churn, but it's been bugging me for a while, and I rather do the self-consistency changes now than later.

The first commit tries to be mostly move-only to help per-file git history.

I intend to revisit rustc-dev-guide's testing docs, but I don't want to do it on rust-lang/rust side because it would need syncing and might conflict.
2025-07-02 19:28:07 +02:00
Matthias Krüger
453a2a9102
Rollup merge of #142886 - Enselic:aarch64-panic, r=cuviper
ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`

The skipped test passes since `nightly-2024-11-29`. See https://github.com/rust-lang/rust/issues/123733#issuecomment-2928770365 and https://github.com/rust-lang/rust/issues/123733#issuecomment-2929091266 for more info.

Let's stop skipping it to increase the chance of detecting a regression.

r? ``````@cuviper`````` who added the skip in https://github.com/rust-lang/rust/pull/123828

Also see https://github.com/rust-lang/rust/pull/142304 for an alternative regression test that I am hoping to also land in the near future to complement the test we now stop skipping, but I need to investigate that setup more.
2025-07-02 19:28:06 +02:00
bors
1ce9c977ff Auto merge of #143214 - camsteffen:remove-let-chains-feature, r=est31
Remove let_chains unstable feature

Per https://github.com/rust-lang/rust/issues/53667#issuecomment-3016742982 (but then I also noticed rust-lang/rust#140722)

This replaces the feature gate with a parser error that says let chains require 2024.

A lot of tests were using the unstable feature. I either added edition:2024 to the test or split out the parts that require 2024.
2025-07-02 17:18:47 +00:00
binarycat
1d3cbb3a1c bootstrap: add CONFIG_CHANGE_HISTORY entry for build.tidy-extra-checks 2025-07-02 10:56:22 -05:00
binarycat
90b2d24692 bootstrap: add build.tidy-extra-checks option 2025-07-02 10:53:55 -05:00
Ralf Jung
8362508989 miri: improve errors for type validity assertion failures 2025-07-02 17:47:46 +02:00
Pavel Grigorenko
2ab641d75e bootstrap: validate rust.codegen-backends & targer.<triple>.codegen-backends 2025-07-02 16:55:47 +03:00
Ralf Jung
8fc0fd5a80 use more clever approach for genmc conditional import 2025-07-02 15:16:03 +02:00
Ralf Jung
de1278bd16 interpret: move the native call preparation logic into Miri 2025-07-02 14:25:11 +02:00
Jakub Beránek
7d35f2f8c0 Use non-global interner in test_string_interning in bootstrap 2025-07-02 14:25:05 +02:00
Jakub Beránek
3f3c498137
Apply review comments 2025-07-02 12:18:56 +02:00
Ralf Jung
510040fb44 skip env var memory for leak check 2025-07-02 12:12:24 +02:00
Samuel Tardieu
b4d35fde7e Add track_caller attributes to trace origin of Clippy lints
This allows the use of `-Z track-diagnostics` to see the origin of
Clippy lints emission, as is already the case for lints coming from
rustc.
2025-07-02 11:50:25 +02:00
Jakub Beránek
e6c64df274
Add cross-compilation check tests 2025-07-02 09:18:53 +02:00
Jakub Beránek
07a1b82442
Add bootstrap tool check test 2025-07-02 09:17:50 +02:00
Jakub Beránek
c17da9ebc2
Add Rust Analyzer check tests 2025-07-02 09:15:08 +02:00
Jakub Beránek
029304e4a6
Add codegen check tests 2025-07-02 09:13:44 +02:00
Jakub Beránek
a7c625146e
Add compiletest check tests 2025-07-02 09:12:37 +02:00
Jakub Beránek
4dfa59dcfb
Add snapshot tests for checking compiler, library and rustc tools 2025-07-02 09:10:39 +02:00
Jakub Beránek
3c391a6394
Automatically derive stage in step metadata where possible 2025-07-02 09:02:48 +02:00
Ralf Jung
0d43e2fe2b
Merge pull request #4406 from Stypox/tracing
Add tracing_chrome under "tracing" feature
2025-07-02 06:55:58 +00:00
Ralf Jung
d2f2271ccd rename show_error -> fatal_error 2025-07-02 08:31:21 +02:00
Stypox
28900b0ee2 Add tracing feature to enable tracing_chrome support 2025-07-02 08:29:13 +02:00
The Miri Cronjob Bot
af5f4be160 Merge from rustc 2025-07-02 05:05:02 +00:00
The Miri Cronjob Bot
9d9f0e0455 Preparing for merge from rustc 2025-07-02 04:57:05 +00:00
Jieyou Xu
0346895e26
Rename {HeadersCache, iter_header} -> {DirectivesCache, iter_directives} for self-consistency 2025-07-02 12:08:00 +08:00
Jieyou Xu
475f447f12
Update compiletest to use "directive" terminology consistently 2025-07-02 12:08:00 +08:00
Jieyou Xu
cf5788d30d
Rename header -> directives
compiletest has confusingly two terminology to refer to the same concept
-- "headers" and "directives". To make this more self-consistent and
less confusing, stick with "directives" only.

This commit **intentionally** tries to be limited to move-only (modulo
some key usage reference renames) to help git history.
2025-07-02 12:07:57 +08:00
bors
f51c9870ba Auto merge of #142974 - cuviper:stage0-bump, r=Mark-Simulacrum
Update stage0 to 1.89.0-beta.1

- Update version placeholders
- Update stage0 to 1.89.0-beta.1
- Update `STAGE0_MISSING_TARGETS`
- Update `cfg(bootstrap)`

r? `@Mark-Simulacrum`

try-job: dist-i586-gnu-i586-i686-musl
2025-07-02 01:41:18 +00:00
bors
085c24790e Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk
Remove support for `dyn*` from the compiler

This PR removes support for `dyn*` (https://github.com/rust-lang/rust/issues/102425), which are a currently un-RFC'd experiment that was opened a few years ago to explore a component that we thought was necessary for AFIDT (async fn in dyn trait).

It doesn't seem like we are going to need `dyn*` types -- even in an not-exposed-to-the-user way[^1] -- for us to implement AFIDT. Given that AFIDT was the original motivating purpose of `dyn*` types, I don't really see a compelling reason to have to maintain their implementation in the compiler.

[^1]: Compared to, e.g., generators whih are an unstable building block we use to implement stable syntax like `async {}`.

We've learned quite a lot from `dyn*`, but I think at this point its current behavior leads to more questions than answers. For example, `dyn*` support today remains somewhat fragile; it ICEs in many cases where the current "normal" `dyn Trait` types rely on their unsizedness for their vtable-based implementation to be sound I wouldn't be surprised if it's unsound in other ways, though I didn't play around with it too much. See the examples below.

```rust
#![feature(dyn_star)]

trait Foo {
    fn hello(self);
}

impl Foo for usize {
    fn hello(self) {
        println!("hello, world");
    }
}

fn main() {
    let x: dyn* Foo = 1usize;
    x.hello();
}
```

And:

```rust
#![feature(dyn_star)]

trait Trait {
    type Out where Self: Sized;
}

fn main() {
    let x: <dyn* Trait as Trait>::Out;
}
```

...and probably many more problems having to do with the intersection of dyn-compatibility and `Self: Sized` bounds that I was too lazy to look into like:
* GATs
* Methods with invalid signatures
* Associated consts

Generally, `dyn*` types also end up getting in the way of working with [normal `dyn` types](https://github.com/rust-lang/rust/issues/102425#issuecomment-1712604409) to an extent that IMO outweighs the benefit of experimentation.

I recognize that there are probably other, more creative usages of `dyn*` that are orthogonal to AFIDT. However, I think any work along those lines should first have to think through some of the more fundamental interactions between `dyn*` and dyn-compatibility before we think about reimplementing them in the type system.

---

I'm planning on removing the `DynKind` enum and the `PointerLike` built-in trait from the compiler after this PR lands.

Closes rust-lang/rust#102425.

cc `@eholk` `@rust-lang/lang` `@rust-lang/types`

Closes rust-lang/rust#116979.
Closes rust-lang/rust#119694.
Closes rust-lang/rust#134591.
Closes rust-lang/rust#104800.
2025-07-01 21:50:21 +00:00
Michael Goulet
2516c33982 Remove support for dyn* 2025-07-01 19:00:21 +00:00
Josh Stone
e851e3e16e Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
Josh Stone
a58050b753 Update STAGE0_MISSING_TARGETS 2025-07-01 10:54:33 -07:00
Josh Stone
47a3bf36bc Update stage0 to 1.89.0-beta.1 2025-07-01 10:54:33 -07:00