]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoFix typo in a comment.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:26:32 +0000 (12:26 -0700)]
Fix typo in a comment.

4 years agoMake an assert message consistent with other asserts.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:22:58 +0000 (12:22 -0700)]
Make an assert message consistent with other asserts.

4 years agoFix imports.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:22:30 +0000 (12:22 -0700)]
Fix imports.

4 years agoAdd a missing newline in the test.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:21:01 +0000 (12:21 -0700)]
Add a missing newline in the test.

4 years agoRename eval_maybe_thread_local_static_const to adjust_global_const.
Vytautas Astrauskas [Thu, 16 Apr 2020 15:34:30 +0000 (08:34 -0700)]
Rename eval_maybe_thread_local_static_const to adjust_global_const.

4 years agoAddress some of the reviewers comments.
Vytautas Astrauskas [Thu, 16 Apr 2020 04:25:12 +0000 (21:25 -0700)]
Address some of the reviewers comments.

4 years agoGenerate thread local allocations in eval_maybe_thread_local_static_const.
Vytautas Astrauskas [Wed, 15 Apr 2020 21:34:34 +0000 (14:34 -0700)]
Generate thread local allocations in eval_maybe_thread_local_static_const.

4 years agoGenerate fresh allocation ids for thread locals in eval_maybe_thread_local_static_const.
Vytautas Astrauskas [Wed, 15 Apr 2020 00:21:52 +0000 (17:21 -0700)]
Generate fresh allocation ids for thread locals in eval_maybe_thread_local_static_const.

4 years agoSmall refactoring in pthread sync: extract common functionallity to separate functions.
Vytautas Astrauskas [Thu, 9 Apr 2020 20:37:38 +0000 (13:37 -0700)]
Small refactoring in pthread sync: extract common functionallity to separate functions.

4 years agoRename ThreadSet to ThreadManager.
Vytautas Astrauskas [Thu, 9 Apr 2020 19:06:33 +0000 (12:06 -0700)]
Rename ThreadSet to ThreadManager.

4 years agoRebase on PR 1157.
Vytautas Astrauskas [Wed, 8 Apr 2020 03:20:41 +0000 (20:20 -0700)]
Rebase on PR 1157.

4 years agoFix pthread_self.
Vytautas Astrauskas [Mon, 6 Apr 2020 23:30:30 +0000 (16:30 -0700)]
Fix pthread_self.

4 years agoRustfmt the test.
Vytautas Astrauskas [Mon, 6 Apr 2020 23:12:25 +0000 (16:12 -0700)]
Rustfmt the test.

4 years agoStore the thread name.
Vytautas Astrauskas [Mon, 6 Apr 2020 23:12:13 +0000 (16:12 -0700)]
Store the thread name.

4 years agoFix comments in TLS.
Vytautas Astrauskas [Mon, 6 Apr 2020 21:41:05 +0000 (14:41 -0700)]
Fix comments in TLS.

4 years agoReport that we do not support foreign thread local statics.
Vytautas Astrauskas [Mon, 6 Apr 2020 21:00:45 +0000 (14:00 -0700)]
Report that we do not support foreign thread local statics.

4 years agoMove pthread_create and related shims to a separate file.
Vytautas Astrauskas [Mon, 6 Apr 2020 20:44:47 +0000 (13:44 -0700)]
Move pthread_create and related shims to a separate file.

4 years agoFix the problem of sending pointed to thread local statics. Add a regression test.
Vytautas Astrauskas [Fri, 3 Apr 2020 23:09:42 +0000 (16:09 -0700)]
Fix the problem of sending pointed to thread local statics. Add a regression test.

4 years agoAdd a test for thread locals.
Vytautas Astrauskas [Wed, 1 Apr 2020 23:28:53 +0000 (16:28 -0700)]
Add a test for thread locals.

4 years agoUpdate to support the updated API.
Vytautas Astrauskas [Wed, 1 Apr 2020 23:28:33 +0000 (16:28 -0700)]
Update to support the updated API.

4 years agoAdd a warning that Miri does not check for data-races.
Vytautas Astrauskas [Wed, 1 Apr 2020 23:26:41 +0000 (16:26 -0700)]
Add a warning that Miri does not check for data-races.

4 years agoImplement basic support for concurrency (Linux only).
Vytautas Astrauskas [Mon, 16 Mar 2020 23:48:44 +0000 (16:48 -0700)]
Implement basic support for concurrency (Linux only).

4 years agoAuto merge of #1373 - RalfJung:test-rename, r=RalfJung
bors [Mon, 27 Apr 2020 10:54:57 +0000 (10:54 +0000)]
Auto merge of #1373 - RalfJung:test-rename, r=RalfJung

rename tests: undefined -> uninit

4 years agoAuto merge of #1370 - samrat:add-scalar-size-test, r=RalfJung
bors [Mon, 27 Apr 2020 10:33:29 +0000 (10:33 +0000)]
Auto merge of #1370 - samrat:add-scalar-size-test, r=RalfJung

Add test to verify that argument size mismatch throws UB

Also, bump up `rust-version`

Closes #1355

4 years agorename tests: undefined -> uninit
Ralf Jung [Mon, 27 Apr 2020 10:27:56 +0000 (12:27 +0200)]
rename tests: undefined -> uninit

4 years agoReplace error-pattern with annotation; remove unreachable line
Samrat Man Singh [Mon, 27 Apr 2020 10:04:42 +0000 (15:34 +0530)]
Replace error-pattern with annotation; remove unreachable line

4 years agoAuto merge of #1354 - divergentdave:dump-alloc-on-undef-read, r=RalfJung
bors [Mon, 27 Apr 2020 09:33:30 +0000 (09:33 +0000)]
Auto merge of #1354 - divergentdave:dump-alloc-on-undef-read, r=RalfJung

Print hex dump of alloc on reading undef bytes

Here's a small addition I made locally to the UB diagnostics, in case you're interested in it. This PR calls `dump_alloc()` on the relevant allocation if Miri fails on UB due to reading undefined bytes. This came in handy when diagnosing such an issue in a large program using unsafe Rust, in part because it wasn't deterministic enough to use `-Zmiri-track-alloc-id=`. If you'd like to put this behind another -Z flag, let me know.

4 years agoFix shim_arg_size test for 32-bit machines
Samrat Man Singh [Mon, 27 Apr 2020 04:30:35 +0000 (10:00 +0530)]
Fix shim_arg_size test for 32-bit machines

4 years agoAdd test to verify arg size mismatch throws UB
Samrat Man Singh [Mon, 27 Apr 2020 04:05:19 +0000 (09:35 +0530)]
Add test to verify arg size mismatch throws UB

Also: bump up `rust-version`

4 years agoReview comments
David Cook [Mon, 27 Apr 2020 03:13:36 +0000 (22:13 -0500)]
Review comments

4 years agoAuto merge of #1368 - Robbepop:add-new-trophy-for-inks-lazyarray, r=RalfJung
bors [Sat, 25 Apr 2020 21:19:56 +0000 (21:19 +0000)]
Auto merge of #1368 - Robbepop:add-new-trophy-for-inks-lazyarray, r=RalfJung

Add miri trophy for LazyArray::swap (ink! PR)

Details to the found in https://github.com/rust-lang/miri/issues/1364.
Note that this was not a found in a `master` or production release of ink!, however without analysing the code via `miri` this could have potentially happened.

4 years agoUpdate README.md
Hero Bird [Sat, 25 Apr 2020 17:42:48 +0000 (19:42 +0200)]
Update README.md

4 years agoAdd miri trophy for LazyArray::swap (ink! PR)
Hero Bird [Sat, 25 Apr 2020 12:58:20 +0000 (14:58 +0200)]
Add miri trophy for LazyArray::swap (ink! PR)

Details to the found in https://github.com/rust-lang/miri/issues/1364.
Note that this was not a found in a `master` or production release of ink!, however without analysing the code via `miri` this could have potentially happened.

4 years agoAuto merge of #1366 - RalfJung:rustc-exit, r=RalfJung
bors [Sat, 25 Apr 2020 09:17:04 +0000 (09:17 +0000)]
Auto merge of #1366 - RalfJung:rustc-exit, r=RalfJung

fix exit code on rustc errors

Fixes https://github.com/rust-lang/miri/issues/1352

4 years agomake sure we do not discard information on the Ok exit side
Ralf Jung [Sat, 25 Apr 2020 09:16:03 +0000 (11:16 +0200)]
make sure we do not discard information on the Ok exit side

4 years agofix exit code on rustc errors
Ralf Jung [Sat, 25 Apr 2020 09:12:50 +0000 (11:12 +0200)]
fix exit code on rustc errors

4 years agoAdd test to exercise InvalidUndefBytes
David Cook [Fri, 24 Apr 2020 01:00:25 +0000 (20:00 -0500)]
Add test to exercise InvalidUndefBytes

4 years agoAdd message before dumping alloc
David Cook [Fri, 24 Apr 2020 01:00:09 +0000 (20:00 -0500)]
Add message before dumping alloc

4 years agoAuto merge of #1361 - RalfJung:rustup, r=RalfJung
bors [Thu, 23 Apr 2020 22:54:29 +0000 (22:54 +0000)]
Auto merge of #1361 - RalfJung:rustup, r=RalfJung

rustup

4 years agorustup
Ralf Jung [Thu, 23 Apr 2020 22:52:43 +0000 (00:52 +0200)]
rustup

4 years agoAuto merge of #1358 - dtolnay:ci, r=RalfJung
bors [Thu, 23 Apr 2020 17:44:25 +0000 (17:44 +0000)]
Auto merge of #1358 - dtolnay:ci, r=RalfJung

Disable interactive prompts in CI

Closes #1357.

4 years agoKeep MiriCommand out of ask_to_run function
David Tolnay [Thu, 23 Apr 2020 17:27:38 +0000 (10:27 -0700)]
Keep MiriCommand out of ask_to_run function

4 years agoAuto merge of #1359 - RalfJung:cargo-bin-exe, r=RalfJung
bors [Thu, 23 Apr 2020 17:23:05 +0000 (17:23 +0000)]
Auto merge of #1359 - RalfJung:cargo-bin-exe, r=RalfJung

test suite: rely on CARGO_BIN_EXE_ env vars

Just read about this in the 1.43 release notes. :)

4 years agotest suite: rely on CARGO_BIN_EXE_ env vars to find Miri binary
Ralf Jung [Thu, 23 Apr 2020 17:20:09 +0000 (19:20 +0200)]
test suite: rely on CARGO_BIN_EXE_ env vars to find Miri binary

4 years agoPreserve consistent output whether or not CI is set
David Tolnay [Thu, 23 Apr 2020 17:12:48 +0000 (10:12 -0700)]
Preserve consistent output whether or not CI is set

4 years agoRemove unneeded setup step from CI instructions in readme
David Tolnay [Thu, 23 Apr 2020 16:12:05 +0000 (09:12 -0700)]
Remove unneeded setup step from CI instructions in readme

4 years agoDisable interactive prompts in CI
David Tolnay [Thu, 23 Apr 2020 15:46:49 +0000 (08:46 -0700)]
Disable interactive prompts in CI

4 years agoAuto merge of #1356 - brson:trophy, r=RalfJung
bors [Thu, 23 Apr 2020 09:19:50 +0000 (09:19 +0000)]
Auto merge of #1356 - brson:trophy, r=RalfJung

Add ryu and tikv to trophy case

4 years agoUpdate README.md
Brian Anderson [Thu, 23 Apr 2020 08:46:36 +0000 (02:46 -0600)]
Update README.md

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoAdd ryu and tikv to trophy case
Brian Anderson [Thu, 23 Apr 2020 02:37:58 +0000 (02:37 +0000)]
Add ryu and tikv to trophy case

4 years agoReorder output
David Cook [Wed, 22 Apr 2020 22:41:06 +0000 (17:41 -0500)]
Reorder output

4 years agoAuto merge of #1348 - RalfJung:raw-addr-of-align, r=RalfJung
bors [Wed, 22 Apr 2020 21:44:14 +0000 (21:44 +0000)]
Auto merge of #1348 - RalfJung:raw-addr-of-align, r=RalfJung

Stacked Borrows: alignment does not matter

Fixes https://github.com/rust-lang/miri/issues/1339
Requires https://github.com/rust-lang/rust/pull/71280

4 years agorustup
Ralf Jung [Wed, 22 Apr 2020 21:32:28 +0000 (23:32 +0200)]
rustup

4 years agoStacked Borrows: alignment does not matter
Ralf Jung [Sat, 18 Apr 2020 11:56:09 +0000 (13:56 +0200)]
Stacked Borrows: alignment does not matter

4 years agoAuto merge of #1353 - divergentdave:file-set-len, r=RalfJung
bors [Wed, 22 Apr 2020 21:10:01 +0000 (21:10 +0000)]
Auto merge of #1353 - divergentdave:file-set-len, r=RalfJung

Implement ftruncate64/ftruncate for File::set_len

This adds a shim for `ftruncate64` (on Linux) or `ftruncate` (on macOS) to enable support for `File::set_len`, and includes a test.

4 years agoAdd comment
David Cook [Wed, 22 Apr 2020 12:09:20 +0000 (07:09 -0500)]
Add comment

4 years agoPrint hex dump of alloc on reading undef bytes
David Cook [Wed, 22 Apr 2020 02:28:22 +0000 (21:28 -0500)]
Print hex dump of alloc on reading undef bytes

4 years agoImplement ftruncate64/ftruncate for File::set_len
David Cook [Wed, 22 Apr 2020 02:17:54 +0000 (21:17 -0500)]
Implement ftruncate64/ftruncate for File::set_len

4 years agoAuto merge of #1335 - vakaras:add-threads-noop, r=RalfJung
bors [Mon, 20 Apr 2020 08:39:29 +0000 (08:39 +0000)]
Auto merge of #1335 - vakaras:add-threads-noop, r=RalfJung

Move the stack to the evaluator. (no-op PR for 70598)

The changes to Miri to make it to compile with Rustc PR https://github.com/rust-lang/rust/pull/70598.

4 years agoadjust for asm -> llvm_asm rename
Ralf Jung [Mon, 20 Apr 2020 08:38:38 +0000 (10:38 +0200)]
adjust for asm -> llvm_asm rename

4 years agoadjust for Weak::as_raw -> as_ptr rename
Ralf Jung [Mon, 20 Apr 2020 08:04:17 +0000 (10:04 +0200)]
adjust for Weak::as_raw -> as_ptr rename

4 years agorustup
Ralf Jung [Mon, 20 Apr 2020 07:33:34 +0000 (09:33 +0200)]
rustup

4 years agoMove stack and stack_mut implementation in Machine to match their position in the...
Vytautas Astrauskas [Thu, 16 Apr 2020 17:14:46 +0000 (10:14 -0700)]
Move stack and stack_mut implementation in Machine to match their position in the trait.

4 years agoMove the stack to the evaluator to make Miri compile with the newest Rustc.
Vytautas Astrauskas [Wed, 1 Apr 2020 23:55:52 +0000 (16:55 -0700)]
Move the stack to the evaluator to make Miri compile with the newest Rustc.

4 years agoAuto merge of #1342 - divergentdave:pause-instruction, r=RalfJung
bors [Sun, 19 Apr 2020 14:53:02 +0000 (14:53 +0000)]
Auto merge of #1342 - divergentdave:pause-instruction, r=RalfJung

Handle std::sync::atomic::spin_loop_hint()

This PR adds support for `std::sync::atomic::spin_loop_hint()` by implementing the `llvm.x86.sse2.pause` intrinsic when the target is x86-based. It appears this is the first LLVM intrinsic in foreign_items, so I added a couple match blocks to handle it or fall through to the different OS-specific methods. I added a basic smoke test to `tests/run-pass/sync.rs`. I came across this by way of `crossbeam::utils::Backoff::spin()`, FWIW.

4 years agoReview comments
David Cook [Sun, 19 Apr 2020 14:22:40 +0000 (09:22 -0500)]
Review comments

4 years agoAuto merge of #1351 - RalfJung:float-test-source, r=RalfJung
bors [Sun, 19 Apr 2020 07:37:25 +0000 (07:37 +0000)]
Auto merge of #1351 - RalfJung:float-test-source, r=RalfJung

note source of float cast test values, and some more UB tests

4 years agotest some more extreme cast cases
Ralf Jung [Sun, 19 Apr 2020 07:34:54 +0000 (09:34 +0200)]
test some more extreme cast cases

4 years agonote source of test values
Ralf Jung [Sun, 19 Apr 2020 07:21:00 +0000 (09:21 +0200)]
note source of test values

4 years agoAdd support for std::thread::yield_now
David Cook [Sun, 19 Apr 2020 00:31:02 +0000 (19:31 -0500)]
Add support for std::thread::yield_now

4 years agoFlip matching
David Cook [Sun, 19 Apr 2020 00:16:52 +0000 (19:16 -0500)]
Flip matching

4 years agoAuto merge of #1349 - RalfJung:machine-layouts, r=RalfJung
bors [Sat, 18 Apr 2020 15:55:41 +0000 (15:55 +0000)]
Auto merge of #1349 - RalfJung:machine-layouts, r=RalfJung

use pre-computed layouts some more

4 years agouse pre-computed layouts some more
Ralf Jung [Sat, 18 Apr 2020 15:53:54 +0000 (17:53 +0200)]
use pre-computed layouts some more

4 years agoAuto merge of #1347 - RalfJung:float-cast-test, r=RalfJung
bors [Sat, 18 Apr 2020 11:08:24 +0000 (11:08 +0000)]
Auto merge of #1347 - RalfJung:float-cast-test, r=RalfJung

rename test_cast -> test_both_cast to make purpose clearer

4 years agorename test_cast -> test_both_cast to make purpose clearer
Ralf Jung [Sat, 18 Apr 2020 11:07:50 +0000 (13:07 +0200)]
rename test_cast -> test_both_cast to make purpose clearer

4 years agoAuto merge of #1325 - RalfJung:float_to_int_unchecked, r=RalfJung
bors [Sat, 18 Apr 2020 08:13:24 +0000 (08:13 +0000)]
Auto merge of #1325 - RalfJung:float_to_int_unchecked, r=RalfJung

implement float_to_int_unchecked

@hanna-kruppe would be great if you could have a look at this.

`float.rs` tests legal casts. `test_cast` checks that both `as` casts and unchecked casts work (i.e., these are not saturating). The `compile-fail` tests should ensure that illegal casts via the intrinsic are detected as such.

Fixes https://github.com/rust-lang/miri/issues/1264

4 years agouse u128::MAX symbolic name
Ralf Jung [Sat, 18 Apr 2020 08:11:45 +0000 (10:11 +0200)]
use u128::MAX symbolic name

4 years agoAuto merge of #1346 - RalfJung:dyn-layout-test, r=RalfJung
bors [Sat, 18 Apr 2020 07:16:35 +0000 (07:16 +0000)]
Auto merge of #1346 - RalfJung:dyn-layout-test, r=RalfJung

Test that we enforce dynamic layout properties (not just static ones of sized prefix)

4 years agosome UB gets masked by optimizations
Ralf Jung [Sat, 18 Apr 2020 07:15:59 +0000 (09:15 +0200)]
some UB gets masked by optimizations

4 years agotest that we check dynamic actual size of object
Ralf Jung [Sat, 18 Apr 2020 00:06:36 +0000 (02:06 +0200)]
test that we check dynamic actual size of object

4 years agotest that we properly check dynamic alignment
Ralf Jung [Fri, 17 Apr 2020 18:43:54 +0000 (20:43 +0200)]
test that we properly check dynamic alignment

4 years agoAuto merge of #1344 - RalfJung:rustup, r=RalfJung
bors [Fri, 17 Apr 2020 12:20:03 +0000 (12:20 +0000)]
Auto merge of #1344 - RalfJung:rustup, r=RalfJung

rustup for FieldsShape::Primitive

4 years agorustup for FieldsShape::Primitive
Ralf Jung [Fri, 17 Apr 2020 12:19:26 +0000 (14:19 +0200)]
rustup for FieldsShape::Primitive

4 years agoAuto merge of #1343 - RalfJung:derive-packed, r=RalfJung
bors [Fri, 17 Apr 2020 09:05:56 +0000 (09:05 +0000)]
Auto merge of #1343 - RalfJung:derive-packed, r=RalfJung

test #[derive] on packed struct

4 years agotest #[derive] on packed struct
Ralf Jung [Fri, 17 Apr 2020 09:03:20 +0000 (11:03 +0200)]
test #[derive] on packed struct

4 years agoHandle std::sync::atomic::spin_loop_hint()
David Cook [Fri, 17 Apr 2020 04:24:57 +0000 (23:24 -0500)]
Handle std::sync::atomic::spin_loop_hint()

4 years agoAuto merge of #1341 - RalfJung:force-ptr-everywhere, r=oli-obk
bors [Thu, 16 Apr 2020 19:07:08 +0000 (19:07 +0000)]
Auto merge of #1341 - RalfJung:force-ptr-everywhere, r=oli-obk

ReadBytesAsPointer is always supported

Cc @oli-obk

4 years agoReadBytesAsPointer is always supported
Ralf Jung [Thu, 16 Apr 2020 16:35:42 +0000 (18:35 +0200)]
ReadBytesAsPointer is always supported

4 years agoAuto merge of #1338 - RalfJung:test-cleanup, r=RalfJung
bors [Thu, 16 Apr 2020 07:46:57 +0000 (07:46 +0000)]
Auto merge of #1338 - RalfJung:test-cleanup, r=RalfJung

Cleanup some run-pass tests

4 years agomerge packed_static and packed_struct
Ralf Jung [Thu, 16 Apr 2020 07:27:40 +0000 (09:27 +0200)]
merge packed_static and packed_struct

4 years agoavoid test-wide allowance of unused/dead code
Ralf Jung [Thu, 16 Apr 2020 07:25:12 +0000 (09:25 +0200)]
avoid test-wide allowance of unused/dead code

4 years agoconsolidate ptr tests in fewer files
Ralf Jung [Thu, 16 Apr 2020 07:06:21 +0000 (09:06 +0200)]
consolidate ptr tests in fewer files

4 years agoAuto merge of #1337 - RalfJung:intrinsic-tests, r=RalfJung
bors [Wed, 15 Apr 2020 16:09:40 +0000 (16:09 +0000)]
Auto merge of #1337 - RalfJung:intrinsic-tests, r=RalfJung

test some so-far untested intrinsics

4 years agotest some so-far untested intrinsics
Ralf Jung [Wed, 15 Apr 2020 16:00:16 +0000 (18:00 +0200)]
test some so-far untested intrinsics

4 years agoAuto merge of #1334 - KrishnaSannasi:track-dealloc, r=RalfJung
bors [Wed, 15 Apr 2020 15:48:07 +0000 (15:48 +0000)]
Auto merge of #1334 - KrishnaSannasi:track-dealloc, r=RalfJung

add deallocation tracking

fixes #1314

4 years agoadded deallocation tracking
Ozaren [Tue, 14 Apr 2020 23:00:56 +0000 (19:00 -0400)]
added deallocation tracking

4 years agoAuto merge of #1336 - RalfJung:instance-sanity, r=RalfJung
bors [Wed, 15 Apr 2020 11:34:34 +0000 (11:34 +0000)]
Auto merge of #1336 - RalfJung:instance-sanity, r=RalfJung

tighten Instance sanity check

Let's see if we can get away with this...

4 years agotighten Instance sanity check
Ralf Jung [Wed, 15 Apr 2020 10:41:54 +0000 (12:41 +0200)]
tighten Instance sanity check

4 years agoAuto merge of #1330 - RalfJung:retag-return-place, r=RalfJung
bors [Wed, 15 Apr 2020 10:41:13 +0000 (10:41 +0000)]
Auto merge of #1330 - RalfJung:retag-return-place, r=RalfJung

retag return place

@eddyb suggested that return places should be treated like unique references for Stacked Borrows. That is implemented by this patch, but it is unfortunately quite the hack because otherwise we are retagging *references*, not places.

@eddyb does this roughly correspond to what you had in mind? (Except for whatever it is you think should happen with argument passing, which is a much bigger issue.) Also, do you think there is any way we can *test* this?

Needs https://github.com/rust-lang/rust/pull/71100 to land.

4 years agorustup
Ralf Jung [Wed, 15 Apr 2020 10:39:28 +0000 (12:39 +0200)]
rustup