]> git.lizzy.rs Git - rust.git/log
rust.git
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

4 years agoretag return places
Ralf Jung [Mon, 13 Apr 2020 15:31:19 +0000 (17:31 +0200)]
retag return places

4 years agoadjust for frame hook changes
Ralf Jung [Mon, 13 Apr 2020 14:08:12 +0000 (16:08 +0200)]
adjust for frame hook changes

4 years agoAuto merge of #1331 - samrat:macos-mach-timebase-info, r=RalfJung
bors [Tue, 14 Apr 2020 09:30:22 +0000 (09:30 +0000)]
Auto merge of #1331 - samrat:macos-mach-timebase-info, r=RalfJung

Implement `mach_timebase_info` for macOS

Since we return nanoseceonds instead of ticks from `mach_absolute_time`, we don't need to scale the absolute time

Fixes #1288

4 years agoReword comment in mach_timebase_info
Samrat Man Singh [Tue, 14 Apr 2020 08:29:43 +0000 (13:59 +0530)]
Reword comment in mach_timebase_info

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoAuto merge of #1333 - RalfJung:flag-test, r=RalfJung
bors [Tue, 14 Apr 2020 08:25:34 +0000 (08:25 +0000)]
Auto merge of #1333 - RalfJung:flag-test, r=RalfJung

Make sure we find many failures even with other checks disabled

4 years agomake sure we find some things without validation or stacked borrows, respectively
Ralf Jung [Tue, 14 Apr 2020 08:03:10 +0000 (10:03 +0200)]
make sure we find some things without validation or stacked borrows, respectively

4 years agomake sure our disable flags do not miss all bugs; move type-assert intrinsic tests...
Ralf Jung [Tue, 14 Apr 2020 07:58:58 +0000 (09:58 +0200)]
make sure our disable flags do not miss all bugs; move type-assert intrinsic tests to their folder

4 years agoUse precomputed TyLayout from `machine.layouts`
Samrat Man Singh [Tue, 14 Apr 2020 08:01:24 +0000 (13:31 +0530)]
Use precomputed TyLayout from `machine.layouts`

And add comment documenting successful return value from
`mach_timebase_info`.

4 years agoAuto merge of #1332 - RalfJung:disable-alignment-check, r=RalfJung
bors [Tue, 14 Apr 2020 07:50:41 +0000 (07:50 +0000)]
Auto merge of #1332 - RalfJung:disable-alignment-check, r=RalfJung

Add option to disable alignment check

Requires https://github.com/rust-lang/rust/pull/71101
Fixes https://github.com/rust-lang/miri/issues/1326

4 years agofix comment in alignment test
Ralf Jung [Tue, 14 Apr 2020 07:50:20 +0000 (09:50 +0200)]
fix comment in alignment test

4 years agorustup
Ralf Jung [Tue, 14 Apr 2020 07:26:47 +0000 (09:26 +0200)]
rustup

4 years agotweak flag section in README
Ralf Jung [Tue, 14 Apr 2020 07:26:42 +0000 (09:26 +0200)]
tweak flag section in README

4 years agoUse pre-defined u32 layout
Samrat Man Singh [Tue, 14 Apr 2020 04:10:40 +0000 (09:40 +0530)]
Use pre-defined u32 layout

Also fix typo and remove newline

4 years agomention new option in README and diagnostics
Ralf Jung [Mon, 13 Apr 2020 15:55:39 +0000 (17:55 +0200)]
mention new option in README and diagnostics

4 years agoadd option to disable alignment checks
Ralf Jung [Mon, 13 Apr 2020 15:51:22 +0000 (17:51 +0200)]
add option to disable alignment checks

4 years ago[macOS] Implement `mach_timebase_info`
Samrat Man Singh [Mon, 13 Apr 2020 15:48:34 +0000 (21:18 +0530)]
[macOS] Implement `mach_timebase_info`

Since we return nanoseceonds instead of ticks from
`mach_absolute_time`, we don't need to scale the absolute time

4 years agoAuto merge of #1329 - RalfJung:readme, r=RalfJung
bors [Mon, 13 Apr 2020 15:41:50 +0000 (15:41 +0000)]
Auto merge of #1329 - RalfJung:readme, r=RalfJung

note Miri's leak check abilities and that they are disabled on Windows

4 years agonote Miri's leak check abilities and that they are disabled on Windows
Ralf Jung [Mon, 13 Apr 2020 09:30:02 +0000 (11:30 +0200)]
note Miri's leak check abilities and that they are disabled on Windows

4 years agoAuto merge of #1328 - RalfJung:align-false-pos, r=RalfJung
bors [Mon, 13 Apr 2020 07:20:03 +0000 (07:20 +0000)]
Auto merge of #1328 - RalfJung:align-false-pos, r=RalfJung

for alignment errors, note that there might be false positives

Cc @shepmaster

```
error: Undefined Behavior: accessing memory with alignment 1, but alignment 8 is required
 --> tests/compile-fail/unaligned_pointers/alignment.rs:8:9
  |
8 |         *y_ptr = 42;
  |         ^^^^^^^^^^^ accessing memory with alignment 1, but alignment 8 is required
  |
  = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior
  = help: but alignment errors can also be false positives, see https://github.com/rust-lang/miri/issues/1074
```

4 years agofor alignment errors, note that there might be false positives
Ralf Jung [Mon, 13 Apr 2020 07:18:11 +0000 (09:18 +0200)]
for alignment errors, note that there might be false positives

4 years agoAuto merge of #1327 - RalfJung:rustup, r=RalfJung
bors [Sun, 12 Apr 2020 22:45:04 +0000 (22:45 +0000)]
Auto merge of #1327 - RalfJung:rustup, r=RalfJung

rustup

4 years agorustup
Ralf Jung [Sun, 12 Apr 2020 22:41:39 +0000 (00:41 +0200)]
rustup

4 years agoremove some unnecessary trait bounds
Ralf Jung [Sun, 12 Apr 2020 20:01:46 +0000 (22:01 +0200)]
remove some unnecessary trait bounds

4 years agoadd tests for invalid float-to-int casts
Ralf Jung [Sun, 12 Apr 2020 10:01:07 +0000 (12:01 +0200)]
add tests for invalid float-to-int casts

4 years agotest some more corner cases in happy float casts
Ralf Jung [Sun, 12 Apr 2020 10:00:55 +0000 (12:00 +0200)]
test some more corner cases in happy float casts

4 years agomove error-pattern to inline annotation where possible
Ralf Jung [Sun, 12 Apr 2020 09:40:53 +0000 (11:40 +0200)]
move error-pattern to inline annotation where possible

4 years agoimplement float_to_int_unchecked
Ralf Jung [Sun, 12 Apr 2020 09:35:12 +0000 (11:35 +0200)]
implement float_to_int_unchecked

4 years agoalso test unsafe cast intrinsic (happy cases)
Ralf Jung [Sun, 12 Apr 2020 09:07:37 +0000 (11:07 +0200)]
also test unsafe cast intrinsic (happy cases)

4 years agoAuto merge of #1324 - RalfJung:intrinsic-orga, r=RalfJung
bors [Sun, 12 Apr 2020 09:07:21 +0000 (09:07 +0000)]
Auto merge of #1324 - RalfJung:intrinsic-orga, r=RalfJung

organize intrinsics in groups

Also remove `pref_align_of` as it was moved into rustc long ago, and `align_of_val` as it doesn't exist (the name is `min_align_of_val`, which we also already handle).

4 years agothere is no 'align_of_val' intrinsic
Ralf Jung [Sun, 12 Apr 2020 09:04:18 +0000 (11:04 +0200)]
there is no 'align_of_val' intrinsic

4 years agoremove an intrinsic that was moved to rustc
Ralf Jung [Sun, 12 Apr 2020 09:02:56 +0000 (11:02 +0200)]
remove an intrinsic that was moved to rustc

4 years agoorganize intrinsics into groups
Ralf Jung [Sun, 12 Apr 2020 09:01:59 +0000 (11:01 +0200)]
organize intrinsics into groups

4 years agoAuto merge of #1323 - RalfJung:noref, r=RalfJung
bors [Sun, 12 Apr 2020 08:40:32 +0000 (08:40 +0000)]
Auto merge of #1323 - RalfJung:noref, r=RalfJung

avoid a bunch of as_ref/as_mut

4 years agoavoid a bunch of as_ref/as_mut
Ralf Jung [Sun, 12 Apr 2020 08:32:36 +0000 (10:32 +0200)]
avoid a bunch of as_ref/as_mut

4 years agoAuto merge of #1322 - RalfJung:noref, r=RalfJung
bors [Sun, 12 Apr 2020 08:09:30 +0000 (08:09 +0000)]
Auto merge of #1322 - RalfJung:noref, r=RalfJung

avoid ref in matches

Inspired by https://internals.rust-lang.org/t/is-ref-more-powerful-than-match-ergonomics/12111

4 years agoavoid ref in matches
Ralf Jung [Sun, 12 Apr 2020 08:08:12 +0000 (10:08 +0200)]
avoid ref in matches

4 years agoAuto merge of #1321 - RalfJung:float, r=RalfJung
bors [Sat, 11 Apr 2020 18:39:06 +0000 (18:39 +0000)]
Auto merge of #1321 - RalfJung:float, r=RalfJung

Even more float cast tests

Copy a bunch of float cast tests from https://github.com/WebAssembly/testsuite/blob/master/conversions.wast. I didn't do all of them though, too lazy... maybe we should have a wasm interpreter written in Rust and run that in Miri and use the wasm test suite directly that way? :P

4 years agoAuto merge of #1320 - RalfJung:tests, r=RalfJung
bors [Sat, 11 Apr 2020 18:11:35 +0000 (18:11 +0000)]
Auto merge of #1320 - RalfJung:tests, r=RalfJung

compile-fail test organization

Move compile-fail tests to appropriate directories.

(run-pass tests often test many things in one file, organized by functions. But for compile-fail tests that is not possible.)

4 years agoAuto merge of #1319 - RalfJung:readme, r=RalfJung
bors [Sat, 11 Apr 2020 16:32:54 +0000 (16:32 +0000)]
Auto merge of #1319 - RalfJung:readme, r=RalfJung

add push_str issue to trophy case

4 years agosmoketest f32 fast-math intrinsics
Ralf Jung [Sat, 11 Apr 2020 09:03:41 +0000 (11:03 +0200)]
smoketest f32 fast-math intrinsics

4 years agosome some int-to-float and float-to-float cast tests from wasm test suite
Ralf Jung [Sat, 11 Apr 2020 09:00:38 +0000 (11:00 +0200)]
some some int-to-float and float-to-float cast tests from wasm test suite

4 years agocopy lots of float-to-int cast tests from wasm test suite
Ralf Jung [Sat, 11 Apr 2020 08:30:55 +0000 (10:30 +0200)]
copy lots of float-to-int cast tests from wasm test suite

4 years agoa few more inf/nan/negz tests
Ralf Jung [Sat, 11 Apr 2020 07:32:34 +0000 (09:32 +0200)]
a few more inf/nan/negz tests

4 years agoorganize compile-fail tests in folders
Ralf Jung [Sat, 11 Apr 2020 07:30:13 +0000 (09:30 +0200)]
organize compile-fail tests in folders

4 years agoadd push_str issue to trophy case
Ralf Jung [Sat, 11 Apr 2020 07:16:55 +0000 (09:16 +0200)]
add push_str issue to trophy case

4 years agoAuto merge of #1308 - RalfJung:miri, r=RalfJung
bors [Fri, 10 Apr 2020 17:09:02 +0000 (17:09 +0000)]
Auto merge of #1308 - RalfJung:miri, r=RalfJung

More explicit build instructions

@ssomers does this help, or do you think there is more we should say?

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

4 years agoAuto merge of #1316 - RalfJung:compiletest, r=RalfJung
bors [Fri, 10 Apr 2020 12:58:10 +0000 (12:58 +0000)]
Auto merge of #1316 - RalfJung:compiletest, r=RalfJung

bump compiletest

4 years agobump compiletest
Ralf Jung [Fri, 10 Apr 2020 12:57:22 +0000 (14:57 +0200)]
bump compiletest

4 years agoAuto merge of #1304 - RalfJung:backtrace-sep, r=RalfJung
bors [Fri, 10 Apr 2020 09:29:35 +0000 (09:29 +0000)]
Auto merge of #1304 - RalfJung:backtrace-sep, r=RalfJung

add empty line before backtrace, to separate it from help text

I think this improves how things look, and makes it easier to see the help text (it currently kind of drowns next to the backtrace).

Before:
```
error: unsupported operation: Miri does not support threading
  --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/thread.rs:68:19
   |
68 |         let ret = libc::pthread_create(&mut native, &attr, thread_start, &*p as *const _ as *mut _);
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Miri does not support threading
   |
   = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
   = note: inside `std::sys::unix::thread::Thread::new` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/thread.rs:68:19
   = note: inside `std::thread::Builder::spawn_unchecked::<[closure@tests/compile-fail/thread-spawn.rs:6:19: 6:24], ()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/thread/mod.rs:492:26
   = note: inside `std::thread::Builder::spawn::<[closure@tests/compile-fail/thread-spawn.rs:6:19: 6:24], ()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/thread/mod.rs:386:18
   = note: inside `std::thread::spawn::<[closure@tests/compile-fail/thread-spawn.rs:6:19: 6:24], ()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/thread/mod.rs:619:5
note: inside `main` at tests/compile-fail/thread-spawn.rs:6:5
  --> tests/compile-fail/thread-spawn.rs:6:5
   |
6  |     thread::spawn(|| {});
   |     ^^^^^^^^^^^^^^^^^^^^
   = note: inside closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:67:34
   = note: inside closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:52:73
   = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1:6030 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:130:5
   = note: inside closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:52:13
   = note: inside `std::panicking::try::do_call::<[closure@DefId(1:6029 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/panicking.rs:331:40
   = note: inside `std::panicking::try::<i32, [closure@DefId(1:6029 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/panicking.rs:274:15
   = note: inside `std::panic::catch_unwind::<[closure@DefId(1:6029 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/panic.rs:394:14
   = note: inside `std::rt::lang_start_internal` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:51:25
   = note: inside `std::rt::lang_start::<()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:67:5
```
After:
```
error: unsupported operation: Miri does not support threading
  --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/thread.rs:68:19
   |
68 |         let ret = libc::pthread_create(&mut native, &attr, thread_start, &*p as *const _ as *mut _);
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Miri does not support threading
   |
   = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support

   = note: inside `std::sys::unix::thread::Thread::new` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/thread.rs:68:19
   = note: inside `std::thread::Builder::spawn_unchecked::<[closure@tests/compile-fail/thread-spawn.rs:6:19: 6:24], ()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/thread/mod.rs:492:26
   = note: inside `std::thread::Builder::spawn::<[closure@tests/compile-fail/thread-spawn.rs:6:19: 6:24], ()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/thread/mod.rs:386:18
   = note: inside `std::thread::spawn::<[closure@tests/compile-fail/thread-spawn.rs:6:19: 6:24], ()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/thread/mod.rs:619:5
note: inside `main` at tests/compile-fail/thread-spawn.rs:6:5
  --> tests/compile-fail/thread-spawn.rs:6:5
   |
6  |     thread::spawn(|| {});
   |     ^^^^^^^^^^^^^^^^^^^^
   = note: inside closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:67:34
   = note: inside closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:52:73
   = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1:6030 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:130:5
   = note: inside closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:52:13
   = note: inside `std::panicking::try::do_call::<[closure@DefId(1:6029 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/panicking.rs:331:40
   = note: inside `std::panicking::try::<i32, [closure@DefId(1:6029 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/panicking.rs:274:15
   = note: inside `std::panic::catch_unwind::<[closure@DefId(1:6029 ~ std[2f86]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/panic.rs:394:14
   = note: inside `std::rt::lang_start_internal` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:51:25
   = note: inside `std::rt::lang_start::<()>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:67:5
```

What do you think?

4 years agoAuto merge of #1315 - RalfJung:housekeeping, r=RalfJung
bors [Fri, 10 Apr 2020 08:35:16 +0000 (08:35 +0000)]
Auto merge of #1315 - RalfJung:housekeeping, r=RalfJung

Housekeeping

4 years agocargo update
Ralf Jung [Fri, 10 Apr 2020 08:28:23 +0000 (10:28 +0200)]
cargo update

4 years agorustup
Ralf Jung [Fri, 10 Apr 2020 08:28:07 +0000 (10:28 +0200)]
rustup

4 years agofix unused warnings in tests
Ralf Jung [Fri, 10 Apr 2020 08:27:59 +0000 (10:27 +0200)]
fix unused warnings in tests

4 years agotweak wording
Ralf Jung [Wed, 8 Apr 2020 13:56:59 +0000 (15:56 +0200)]
tweak wording

4 years agoAuto merge of #1313 - RalfJung:trophy, r=RalfJung
bors [Wed, 8 Apr 2020 13:22:21 +0000 (13:22 +0000)]
Auto merge of #1313 - RalfJung:trophy, r=RalfJung

add EbrCell to trophy case

Thanks @Firstyear for letting me know about this :)

4 years agoadd EbrCell to trophy case
Ralf Jung [Wed, 8 Apr 2020 13:17:26 +0000 (15:17 +0200)]
add EbrCell to trophy case

4 years agomore editing
Ralf Jung [Wed, 8 Apr 2020 10:30:45 +0000 (12:30 +0200)]
more editing

4 years agomore editing for CONTRIBUTING guide
Ralf Jung [Wed, 8 Apr 2020 09:39:35 +0000 (11:39 +0200)]
more editing for CONTRIBUTING guide

4 years agoAuto merge of #1301 - RalfJung:global-leaks, r=RalfJung
bors [Tue, 7 Apr 2020 17:33:24 +0000 (17:33 +0000)]
Auto merge of #1301 - RalfJung:global-leaks, r=RalfJung

memory reachable through globals is not a leak

Blocked on https://github.com/rust-lang/rust/pull/70762
Fixes https://github.com/rust-lang/miri/issues/940

4 years agorustup
Ralf Jung [Tue, 7 Apr 2020 17:33:03 +0000 (19:33 +0200)]
rustup

4 years agomemory reachable through globals is not a leak any more; adjust for better memory...
Ralf Jung [Sat, 4 Apr 2020 11:35:30 +0000 (13:35 +0200)]
memory reachable through globals is not a leak any more; adjust for better memory dumping

4 years agoAuto merge of #1310 - RalfJung:float-assoc, r=RalfJung
bors [Tue, 7 Apr 2020 14:42:34 +0000 (14:42 +0000)]
Auto merge of #1310 - RalfJung:float-assoc, r=RalfJung

prefer float assoc consts over std module

4 years agoprefer float assoc consts over std module
Ralf Jung [Tue, 7 Apr 2020 14:13:19 +0000 (16:13 +0200)]
prefer float assoc consts over std module

4 years agoAuto merge of #1157 - divergentdave:shim-pthread-try-lock, r=RalfJung
bors [Mon, 6 Apr 2020 13:55:53 +0000 (13:55 +0000)]
Auto merge of #1157 - divergentdave:shim-pthread-try-lock, r=RalfJung

Add shims for RwLock::try_read/RwLock::try_write

This implements proper locking so that we can check for reentrancy and implement the `try_*` methods.

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