Commit graph

1777 commits

Author SHA1 Message Date
Matthias Krüger
80ee0c08d6 remove redundant clone 2024-01-05 21:19:45 +01:00
The Miri Conjob Bot
d11a2bdc1d Merge from rustc 2024-01-05 05:12:56 +00:00
The Miri Conjob Bot
4c4c6a6de3 Preparing for merge from rustc 2024-01-05 05:06:22 +00:00
Matthias Krüger
657937850b
Rollup merge of #119574 - RalfJung:miri, r=oli-obk
Miri subtree update

r? `@ghost`
2024-01-04 15:34:01 +01:00
Ralf Jung
5aa15b6ee7 miri: do not forward RUSTFLAGS to deps build 2024-01-04 12:30:38 +01:00
bors
38847aeb76 Auto merge of #3239 - beepster4096:windows_sys_tests, r=RalfJung
Use `windows-sys` in windows tests

This PR adds `windows-sys` to `test_dependencies` so that we don't have to write out windows api bindings for each test.
2023-12-30 19:57:21 +00:00
DrMeepster
109ada8e9e undo some lockfile changes, add explicit types to tests 2023-12-29 12:33:27 -08:00
Ben Kimock
4da47a4180 Fix integer overflow ICEs from round_up_to_next_multiple_of 2023-12-28 15:43:05 -05:00
bors
a63fd5ea6b Auto merge of #3244 - RalfJung:nan-nondet, r=RalfJung
NaN non-determinism for intrinsics and libm functions
2023-12-28 11:57:27 +00:00
Ralf Jung
771e47929f don't test unspecified case 2023-12-28 12:56:07 +01:00
Ralf Jung
ee42d1eb9f NaN non-determinism for SIMD intrinsics 2023-12-28 12:14:06 +01:00
Ralf Jung
0f98c0e610 add NaN-nondet to libm functions 2023-12-28 11:07:56 +01:00
Ralf Jung
86198a15d7 make float intrinsics return non-deterministic NaN 2023-12-28 09:29:24 +01:00
bors
0c2c93e78a Auto merge of #3240 - Jefffrey:tempfile, r=RalfJung
Support for tempfile crate on UNIX hosts

Reviving old PR: https://github.com/rust-lang/miri/pull/2720

Attempted to apply the changes as suggested by https://github.com/rust-lang/miri/pull/2720#issuecomment-1347867264

To fix tempfile to work for UNIX targets only and fall back to previous behaviour of only supporting default mode for Windows targets
2023-12-27 21:45:18 +00:00
Pointerbender
cf2ef7dc79 Support for tempfile crate on UNIX hosts
Co-authored-by: Jefffrey <22608443+Jefffrey@users.noreply.github.com>
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-12-28 08:18:50 +11:00
Ralf Jung
dae48ea4bb fast_math: detect non-finite results 2023-12-27 20:31:28 +01:00
Ralf Jung
0f9baa8a31 custom mir: make it clear what the return block is 2023-12-26 20:15:26 +01:00
The Miri Conjob Bot
236ae9905a Merge from rustc 2023-12-26 05:00:54 +00:00
The Miri Conjob Bot
f2407d98de Preparing for merge from rustc 2023-12-26 04:54:17 +00:00
DrMeepster
ac9368ab1e have windows tests use windows-sys 2023-12-25 17:09:14 -08:00
The Miri Conjob Bot
29f25ee3f3 Merge from rustc 2023-12-24 05:00:43 +00:00
The Miri Conjob Bot
f3db65df94 Preparing for merge from rustc 2023-12-24 04:54:07 +00:00
Nicholas Nethercote
8a9db25459 Remove more Session methods that duplicate DiagCtxt methods. 2023-12-24 08:17:47 +11:00
Nicholas Nethercote
99472c7049 Remove Session methods that duplicate DiagCtxt methods.
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
2023-12-24 08:05:28 +11:00
Michael Goulet
e0d7a72c46
Rollup merge of #119171 - nnethercote:cleanup-errors-4, r=compiler-errors
Cleanup error handlers: round 4

More `rustc_errors` cleanups. A sequel to #118933.

r? `@compiler-errors`
2023-12-22 21:41:03 -05:00
Nicholas Nethercote
00e8485057 Remove all uses of DiagnosticBuilder::forget_guarantee().
There are only three. It's simpler to make the type
`DiagnosticBuilder<'_, ()>` from the start, no matter the level, than to
change the guarantee later.
2023-12-23 13:23:28 +11:00
Ralf Jung
e8a4bd17f3 implement and test simd_masked_load and simd_masked_store 2023-12-22 12:25:53 +01:00
Ralf Jung
84304fc00a simd_scatter/gather: test OOB cases and the order of writes 2023-12-22 12:03:54 +01:00
Pietro Albini
f9f5840eb4
update cfg(bootstrap)s 2023-12-22 11:14:11 +01:00
Ralf Jung
bddf1d7590 Merge from rustc 2023-12-21 17:45:02 +01:00
Ralf Jung
f0b84564d4 Preparing for merge from rustc 2023-12-21 17:44:27 +01:00
bors
5ac4c8a63e Auto merge of #119037 - RalfJung:repr-c-abi-mismatch, r=scottmcm
do not allow ABI mismatches inside repr(C) types

In https://github.com/rust-lang/rust/pull/115476 we allowed ABI mismatches inside `repr(C)` types. This wasn't really discussed much; I added it because from how I understand calling conventions, this should actually be safe in practice. However I entirely forgot to actually allow this in Miri, and in the mean time I have learned that too much ABI compatibility can be a problem for CFI (it can reject fewer calls so that gives an attacker more room to play with).

So I propose we take back that part about ABI compatibility in `repr(C)`. It is anyway something that C and C++ do not allow, as far as I understand.

In the future we might want to introduce a class of ABI compatibilities where we say "this is a bug and it may lead to aborting the process, but it won't lead to arbitrary misbehavior -- worst case it'll just transmute the arguments from the caller type to the callee type". That would give CFI leeway to reject such calls without introducing the risk of arbitrary UB. (The UB can still happen if the transmute leads to bad results, of course, but it wouldn't be due to ABI weirdness.)

#115476 hasn't reached beta yet so if we land this before Dec 22nd we can just pretend this all never happened. ;)  Otherwise we should do a beta backport (of the docs change at least).

Cc `@rust-lang/opsem` `@rust-lang/types`
2023-12-20 18:04:40 +00:00
The Miri Conjob Bot
0f70ced128 Merge from rustc 2023-12-19 05:00:53 +00:00
The Miri Conjob Bot
245f2ad429 Preparing for merge from rustc 2023-12-19 04:54:11 +00:00
bors
1929606c3e Auto merge of #3220 - saethlin:strict-mmap, r=RalfJung
Make mmap not use expose semantics

Fixes https://github.com/rust-lang/miri/issues/3041 per https://github.com/rust-lang/miri/issues/3041#issuecomment-1711235196
2023-12-18 20:10:43 +00:00
bors
91b406f3f6 Auto merge of #3221 - RalfJung:edition, r=RalfJung
./miri run: default to edition 2021

Fixes https://github.com/rust-lang/miri/issues/2999
2023-12-18 17:53:07 +00:00
Nicholas Nethercote
f6aa418c9f Rename many DiagCtxt and EarlyDiagCtxt locals. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
d58e372853 Rename many EarlyDiagCtxt arguments. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
09af8a667c Rename Session::span_diagnostic as Session::dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
cce1701c4c Rename EarlyErrorHandler as EarlyDiagCtxt. 2023-12-18 16:06:21 +11:00
Ben Kimock
4e2235a480 Make mmap not use expose semantics 2023-12-17 22:57:15 -05:00
Ralf Jung
c54312d079 rustc-push: automatically fill PR body to avoid reviewer assignment 2023-12-17 10:13:08 +01:00
Ralf Jung
c7e3b3f84c do not allow ABI mismatches inside repr(C) types 2023-12-17 09:34:25 +01:00
Ben Kimock
ce4f57511e Visit the AllocIds and BorTags in borrow state FrameExtra 2023-12-16 11:56:42 -05:00
bors
fcb89b394a Auto merge of #3226 - saethlin:deadpool-test, r=RalfJung
Add a regression test for rust#115145

Per https://github.com/rust-lang/rust/pull/118805#issuecomment-1855264860
2023-12-15 15:05:41 +00:00
Ben Kimock
afcf01c238 Add the test minimized from deadpool 2023-12-15 10:04:07 -05:00
The Miri Conjob Bot
b0d92a7653 Merge from rustc 2023-12-15 05:01:08 +00:00
The Miri Conjob Bot
7c5d692a4e Preparing for merge from rustc 2023-12-15 04:54:30 +00:00
Jubilee
9e872b7cd8
Rollup merge of #118933 - nnethercote:cleanup-errors-even-more, r=compiler-errors
Cleanup errors handlers even more

A sequel to #118587.

r? `@compiler-errors`
2023-12-14 16:07:48 -08:00
Nicholas Nethercote
9a78412511 Split Handler::emit_diagnostic in two.
Currently, `emit_diagnostic` takes `&mut self`.

This commit changes it so `emit_diagnostic` takes `self` and the new
`emit_diagnostic_without_consuming` function takes `&mut self`.

I find the distinction useful. The former case is much more common, and
avoids a bunch of `mut` and `&mut` occurrences. We can also restrict the
latter with `pub(crate)` which is nice.
2023-12-15 10:13:12 +11:00