Commit graph

4356 commits

Author SHA1 Message Date
bors
a001497644 Auto merge of #143745 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to `ui_test` bump and restructure.
2025-07-14 19:53:18 +00:00
Samuel Tardieu
30b46e3f8c
Rollup merge of #143710 - joshtriplett:random-updates, r=joshtriplett
Updates to random number generation APIs

Updates based on discussions about random number generation.

- Add comment on `RandomSource::fill_bytes` about multiple calls, to allow
  efficient implementations for random sources that generate a word at a time.

- Drop the `Random` trait in favor of `Distribution<T>`, which will let people
  make calls like random(1..=6), and which allows for future expansion to
  non-uniform distributions, as well as floating-point. (For now, this is only
  implemented for `RangeFull`, to get the interface in place. Subsequent PRs
  will implement it for other range types.)
2025-07-14 18:05:44 +02:00
Matthias Krüger
762b3143fc
Rollup merge of #143634 - nia-e:init-and-wildcards, r=RalfJung
interpret/allocation: expose init + write_wildcards on a range

Part of https://github.com/rust-lang/miri/pull/4456, so that we can mark down when a foreign access to our memory happened. Should this also move `prepare_for_native_access()` itself into Miri, given that everything there can be implemented on Miri's side?

r? `````@RalfJung`````
2025-07-13 15:15:58 +02:00
Ralf Jung
a0a8e80604 fix clippy_test_deps workspace handling 2025-07-12 12:10:04 +02:00
Ralf Jung
b0e4c3594f ./x test miri: fix cleaning the miri_ui directory 2025-07-12 09:40:35 +02:00
Josh Triplett
900aa00584 Update miri for change to random API 2025-07-11 11:13:47 -07:00
Nia Espera
8d0e0c6d6f
interpret/allocation: expose init + write_wildcards on a range 2025-07-10 16:33:31 +02:00
Stypox
e5f7d4d783
Implement enter_trace_span() in MiriMachine 2025-07-08 15:37:01 +02:00
许杰友 Jieyou Xu (Joe)
eed55947ac
Rollup merge of #143528 - RalfJung:stack-pop-cleanup, r=oli-obk
interpret: rename StackPopCleanup

The name `StackPopCleanup` stopped making sense a long time ago IMO -- in the common case, it has nothing to do with "cleanup", and everything with where the program should jump next. If we didn't have unwinding this would be just the return block, but given that we do have unwinding I figured maybe "continuation" would be a good name. This comes up in [continuation-passing style](https://en.wikipedia.org/wiki/Continuation-passing_style) and refers to where the program will *continue* when a function is done. So from a PL perspective it is the most fitting term I think -- but it may be too jargony.

r? `@oli-obk` what do you think?
2025-07-07 19:45:41 +08:00
bors
ca98d4d4b3 Auto merge of #141829 - dvdsk:sleep_until_linux, r=cuviper,RalfJung
Specialize sleep_until implementation for unix (except mac)

related tracking issue: https://github.com/rust-lang/rust/issues/113752
Supersedes https://github.com/rust-lang/rust/pull/118480 for the reasons see: https://github.com/rust-lang/rust/issues/113752#issuecomment-2902594469

Replaces the generic catch all implementation with target_os specific ones for: linux/netbsd/freebsd/android/solaris/illumos etc. Other platforms like wasi, macos/ios/tvos/watchos and windows will follow in later separate PR's (once this is merged).
2025-07-06 23:00:51 +00:00
dvdsk
61cf174dce
sleep_until: add clock_nanosleep support to Miri
The clock_nanosleep support is there to allow code using `sleep_until`
to run under Miri. Therefore the implementation is minimal.
- Only the clocks REALTIME and MONOTONIC are supported. The first is supported simply
because it was trivial to add not because it was needed for sleep_until.
- The only supported flag combinations are no flags or TIMER_ABSTIME only.
If an unsupported flag combination or clock is passed in this throws
unsupported.
2025-07-06 17:49:35 +02:00
Ralf Jung
7775166528 interpret: rename StackPopCleanup 2025-07-06 16:07:35 +02:00
Ralf Jung
72043e3181 fmt 2025-07-05 09:12:36 +02:00
Ralf Jung
61f3705920 Merge from rustc 2025-07-05 09:12:26 +02:00
Ralf Jung
1620117f94 Preparing for merge from rustc 2025-07-05 09:01:43 +02:00
Matthias Krüger
2faf66d091
Rollup merge of #143387 - dpaoliello:shouldpanicfn, r=bjorn3
Make __rust_alloc_error_handler_should_panic a function

Fixes rust-lang/rust#143253

`__rust_alloc_error_handler_should_panic` is a static but was being exported as a function.

For most targets this doesn't matter, but Arm64EC Windows uses different decorations for exported variables vs functions, hence it fails to link when `-Z oom=abort` is enabled.

We've had issues in the past with statics like this (see rust-lang/rust#141061) but the tldr; is that Arm64EC needs symbols correctly exported as either a function or data, and data MUST and MUST ONLY be marked `dllimport` when the symbol is being imported from another binary, which is non-trivial to calculate for these compiler-generated statics.

So, instead, the easiest thing to do is to make `__rust_alloc_error_handler_should_panic` a function instead.

Since `__rust_alloc_error_handler_should_panic` isn't involved in any linking shenanigans, I've marked it as `AlwaysInline` with the hopes that the various backends will see that it is just returning a constant and perform the same optimizations as the previous implementation.

r? `@bjorn3`
2025-07-04 16:22:36 +02:00
Ralf Jung
0d656e0de5 declare data race and weak memory support as non-experimental 2025-07-04 15:07:19 +02:00
The Miri Cronjob Bot
f655289d49 Merge from rustc 2025-07-04 05:05:03 +00:00
The Miri Cronjob Bot
04522bb89c Preparing for merge from rustc 2025-07-04 04:57:31 +00:00
Daniel Paoliello
2b22d0f0d2 Make __rust_alloc_error_handler_should_panic a function 2025-07-03 10:52:21 -07:00
Ralf Jung
7ea812fd54 nanosleep: fix argument name and add a missing argument read 2025-07-03 17:48:33 +02:00
Jana Dönszelmann
f6d37a25a9
Rollup merge of #134006 - klensy:typos, r=nnethercote
setup typos check in CI

This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying?

Also includes commits with actual typo fixes.

MCP: https://github.com/rust-lang/compiler-team/issues/817

typos check currently turned for:
* ./compiler
* ./library
* ./src/bootstrap
* ./src/librustdoc

After merging, PRs which enables checks for other crates (tools) can be implemented too.

Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr.

Check typos: `python x.py test tidy --extra-checks=spellcheck`
Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo)

Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
2025-07-03 13:29:35 +02:00
Ralf Jung
484c64b161 Merge from rustc 2025-07-03 10:28:08 +02:00
Ralf Jung
2cbbd6c9f5 Preparing for merge from rustc 2025-07-03 10:28:05 +02:00
klensy
c76d032f01 setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03: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
Ralf Jung
8362508989 miri: improve errors for type validity assertion failures 2025-07-02 17:47:46 +02: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
Ralf Jung
510040fb44 skip env var memory for leak check 2025-07-02 12:12:24 +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
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
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
Ralf Jung
0ca067190b
Merge pull request #4411 from LorrensP-2158466/remove-leaky-syncobj
Remove leaky synchronisation objects.
2025-07-01 12:46:31 +00:00
LorrensP-2158466
4606afb125 Remove leaky synchronisation objects. 2025-07-01 14:21:13 +02:00
bors
076a0a26fd Auto merge of #143013 - bjorn3:split_exported_symbols, r=oli-obk
Split exported_symbols for generic and non-generic symbols

This reduces metadata decoder overhead during the monomorphization collector.
2025-07-01 11:53:02 +00:00
Ralf Jung
b9b8fd22bb
Merge pull request #4433 from RalfJung/ci-balance
re-balance CI jobs
2025-07-01 06:13:45 +00:00
Ralf Jung
d72b15b883
Merge pull request #4432 from RalfJung/no-metadata
./miri toolchain: no need to run 'cargo metadata'
2025-07-01 05:56:12 +00:00
Ralf Jung
828f5944f8 re-balance CI jobs 2025-07-01 07:48:10 +02:00
Ralf Jung
c52d522298 ./miri toolchain: no need to run 'cargo metadata' 2025-07-01 07:24:40 +02:00
The Miri Cronjob Bot
8958967fd4 fmt 2025-07-01 05:07:00 +00:00
The Miri Cronjob Bot
e6371c9379 Merge from rustc 2025-07-01 05:05:50 +00:00
The Miri Cronjob Bot
0c3c9e4438 Preparing for merge from rustc 2025-07-01 04:58:24 +00:00
Matthias Krüger
8292936d74
Rollup merge of #143140 - RalfJung:ptr-into-parts, r=oli-obk
give Pointer::into_parts a more scary name and offer a safer alternative

`into_parts` is a bit too innocent of a name for a somewhat subtle operation.
r? `@oli-obk`
2025-06-30 20:49:41 +02:00