Commit Graph

4690 Commits

Author SHA1 Message Date
Ozaren
b77968e8bd
added deallocation tracking 2020-04-15 11:29:35 -04:00
bors
e4eceba7d3 Auto merge of #1336 - RalfJung:instance-sanity, r=RalfJung
tighten Instance sanity check

Let's see if we can get away with this...
2020-04-15 11:34:34 +00:00
Ralf Jung
a85dab42ea tighten Instance sanity check 2020-04-15 13:13:17 +02:00
bors
fbea3e57f3 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.
2020-04-15 10:41:13 +00:00
Ralf Jung
3548dcf8cc rustup 2020-04-15 12:39:28 +02:00
Ralf Jung
0805b4bf2e retag return places 2020-04-15 12:39:19 +02:00
Ralf Jung
90d71cd13f adjust for frame hook changes 2020-04-15 12:33:52 +02:00
bors
669191bca9 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
2020-04-14 09:30:22 +00:00
Samrat Man Singh
fff45b77ad
Reword comment in mach_timebase_info
Co-Authored-By: Ralf Jung <post@ralfj.de>
2020-04-14 13:59:43 +05:30
bors
4ed3d487a6 Auto merge of #1333 - RalfJung:flag-test, r=RalfJung
Make sure we find many failures even with other checks disabled
2020-04-14 08:25:34 +00:00
Ralf Jung
e6822d60b3 make sure we find some things without validation or stacked borrows, respectively 2020-04-14 10:23:47 +02:00
Ralf Jung
179e78d0ad make sure our disable flags do not miss all bugs; move type-assert intrinsic tests to their folder 2020-04-14 10:23:47 +02:00
Samrat Man Singh
90729bb039 Use precomputed TyLayout from machine.layouts
And add comment documenting successful return value from
`mach_timebase_info`.
2020-04-14 13:31:24 +05:30
bors
03715907f4 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
2020-04-14 07:50:41 +00:00
Ralf Jung
f4a15444cf fix comment in alignment test 2020-04-14 09:50:20 +02:00
Ralf Jung
8e73db6510 rustup 2020-04-14 09:40:00 +02:00
Ralf Jung
48aaf674f7 tweak flag section in README 2020-04-14 09:39:57 +02:00
Samrat Man Singh
f6bb8111f2 Use pre-defined u32 layout
Also fix typo and remove newline
2020-04-14 09:40:40 +05:30
Ralf Jung
0ad1114153 mention new option in README and diagnostics 2020-04-13 17:58:03 +02:00
Ralf Jung
fd8beaf5c4 add option to disable alignment checks 2020-04-13 17:58:03 +02:00
Samrat Man Singh
5f6d250b30 [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
2020-04-13 21:18:34 +05:30
bors
df0e32c757 Auto merge of #1329 - RalfJung:readme, r=RalfJung
note Miri's leak check abilities and that they are disabled on Windows
2020-04-13 15:41:50 +00:00
Ralf Jung
a6b66c31d7 note Miri's leak check abilities and that they are disabled on Windows 2020-04-13 11:30:02 +02:00
bors
fbbd4428d0 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
```
2020-04-13 07:20:03 +00:00
Ralf Jung
75297d3536 for alignment errors, note that there might be false positives 2020-04-13 09:18:11 +02:00
bors
4545effbcf Auto merge of #1327 - RalfJung:rustup, r=RalfJung
rustup
2020-04-12 22:45:04 +00:00
Ralf Jung
91d7964513 rustup 2020-04-13 00:44:29 +02:00
Ralf Jung
a82efce590 remove some unnecessary trait bounds 2020-04-12 22:01:46 +02:00
Ralf Jung
17c52d47e7 add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
Ralf Jung
25c71e5c0e test some more corner cases in happy float casts 2020-04-12 12:01:20 +02:00
Ralf Jung
30d07c8616 move error-pattern to inline annotation where possible 2020-04-12 12:01:20 +02:00
Ralf Jung
78ce616490 implement float_to_int_unchecked 2020-04-12 12:01:20 +02:00
Ralf Jung
8d1f5336c2 also test unsafe cast intrinsic (happy cases) 2020-04-12 12:01:20 +02:00
bors
85dff8b67a 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).
2020-04-12 09:07:21 +00:00
Ralf Jung
2a3ce5d618 there is no 'align_of_val' intrinsic 2020-04-12 11:04:18 +02:00
Ralf Jung
fd0957f5cd remove an intrinsic that was moved to rustc 2020-04-12 11:02:56 +02:00
Ralf Jung
6414003ab9 organize intrinsics into groups 2020-04-12 11:01:59 +02:00
bors
c827d1fd9c Auto merge of #1323 - RalfJung:noref, r=RalfJung
avoid a bunch of as_ref/as_mut
2020-04-12 08:40:32 +00:00
Ralf Jung
314e7238cf avoid a bunch of as_ref/as_mut 2020-04-12 10:32:36 +02:00
bors
a1c9ad8e1b 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
2020-04-12 08:09:30 +00:00
Ralf Jung
97791a56da avoid ref in matches 2020-04-12 10:08:12 +02:00
bors
aad2c5af06 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
2020-04-11 18:39:06 +00:00
bors
8c396609d0 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.)
2020-04-11 18:11:35 +00:00
bors
e042e2ceef Auto merge of #1319 - RalfJung:readme, r=RalfJung
add push_str issue to trophy case
2020-04-11 16:32:54 +00:00
Ralf Jung
e5e0ced87e smoketest f32 fast-math intrinsics 2020-04-11 11:37:26 +02:00
Ralf Jung
faff175f3e some some int-to-float and float-to-float cast tests from wasm test suite 2020-04-11 11:37:26 +02:00
Ralf Jung
5db01f7371 copy lots of float-to-int cast tests from wasm test suite 2020-04-11 11:37:26 +02:00
Ralf Jung
c63c413331 a few more inf/nan/negz tests 2020-04-11 11:37:26 +02:00
Ralf Jung
b2bf4ec2f5 organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
Ralf Jung
ea37f580e4 add push_str issue to trophy case 2020-04-11 09:16:55 +02:00