Commit Graph

6303 Commits

Author SHA1 Message Date
Ralf Jung 8d1b2ca3ec check that tag_alloc_base_pointer is not called on the wrong things 2022-06-21 21:03:40 -07:00
bors cbb649adfe Auto merge of #2249 - dtolnay-contrib:rustfmt3, r=oli-obk
Format tests with rustfmt (151-200 of 300)

Extracted from #2097.

This PR is still only doing the easy cases with no comments involved.

In the next PRs after this, I'll start grouping by common comment patterns, e.g. all the cases resembling https://github.com/rust-lang/miri/pull/2097#discussion_r862436672 together in one PR.
2022-06-21 07:39:16 +00:00
bors 332f2894ed Auto merge of #2246 - dtolnay-contrib:rustfmt1, r=oli-obk
Format tests with rustfmt (51-100 of 300)

Extracted from #2097.

Like #2244, this is intended to be "easy" cases which don't involve comments in the vicinity.
2022-06-21 06:57:41 +00:00
David Tolnay 1c66163871 Bless stderr files after rustfmt 2022-06-20 23:50:49 -07:00
David Tolnay 30376ba709 Manual adjustments 2022-06-20 23:50:45 -07:00
David Tolnay 069f5b6615 Format tests with rustfmt (151-200 of 300) 2022-06-20 23:50:40 -07:00
David Tolnay 8efc049a9f Manual adjustments 2022-06-20 21:36:11 -07:00
bors bdf2a8a78c Auto merge of #2247 - dtolnay-contrib:rustfmt2, r=RalfJung
Format tests with rustfmt (101-150 of 300)

Extracted from #2097.

Like https://github.com/rust-lang/miri/pull/2244, these are "easy" cases that do not involve moving around comments.
2022-06-21 04:12:42 +00:00
bors 4d712a327f Auto merge of #2244 - dtolnay-contrib:rustfmt0, r=RalfJung
Format tests and benches with rustfmt (1-50 of 300)

Extracted from #2097.

I filtered this PR to contain exclusively "easy" cases to start off with, i.e. where there is no compiletest_rs (or other) comment in the vicinity that might need to get manually repositioned.
2022-06-21 02:51:35 +00:00
David Tolnay 6b8c371f06 Manual adjustments 2022-06-20 16:09:49 -07:00
David Tolnay df8d8b655b Format tests with rustfmt (101-150 of 300) 2022-06-20 16:09:45 -07:00
David Tolnay fafeccaef7 Bless stdout files after rustfmt 2022-06-20 15:39:50 -07:00
David Tolnay 619813500b Format tests with rustfmt (51-100 of 300) 2022-06-20 15:39:46 -07:00
David Tolnay 53580c1e18 Add rustfmt CI for currently formatted directories 2022-06-20 09:00:49 -07:00
David Tolnay fed5ea8b10 Manual adjustments 2022-06-20 09:00:49 -07:00
bors b2616ced5c Auto merge of #2243 - saethlin:color-always, r=oli-obk
Pass --color=always through cargo-miri

Closes https://github.com/rust-lang/miri/issues/2037

I just implemented the fix suggested in that issue and it seems to work without issue.
2022-06-20 15:12:55 +00:00
Ben Kimock 6cd74ee9c7 Pass --color=always through cargo-miri 2022-06-20 11:02:56 -04:00
David Tolnay ee132c8d07 Bless stderr files after rustfmt 2022-06-20 02:23:53 -07:00
David Tolnay 66e8751afc Format tests and benches with rustfmt (1-50 of 300) 2022-06-20 02:23:53 -07:00
bors fe04faf0ce Auto merge of #2242 - dtolnay-contrib:rustfmtskip, r=RalfJung
Add rustfmt::skip to some files

Extracted from https://github.com/rust-lang/miri/pull/2097.

Five of the files being skipped here are because rustfmt is buggy (https://github.com/rust-lang/rustfmt/issues/5391; see the error messages below). The other two have clearly preferable manual formatting.

```console
error[internal]: left behind trailing whitespace
  --> tests/fail/validity/transmute_through_ptr.rs:18:18:1
   |
18 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read2.rs:10:10:1
   |
10 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read5.rs:15:15:1
   |
15 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read1.rs:10:10:1
   |
10 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
 --> /git/miri/tests/fail/erroneous_const2.rs:9:9:1
  |
9 |
  | ^^^^
  |

warning: rustfmt has failed to format. See previous 1 errors.
```
2022-06-20 05:23:46 +00:00
David Tolnay 817adda794 Add rustfmt::skip to some files
Five of the files being skipped here are because rustfmt is buggy (see
the error messages below). The others have clearly preferable manual
formatting.

    error[internal]: left behind trailing whitespace
      --> tests/fail/validity/transmute_through_ptr.rs:18:18:1
       |
    18 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read2.rs:10:10:1
       |
    10 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read5.rs:15:15:1
       |
    15 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read1.rs:10:10:1
       |
    10 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
     --> tests/fail/erroneous_const2.rs:9:9:1
      |
    9 |
      | ^^^^
      |

    warning: rustfmt has failed to format. See previous 1 errors.
2022-06-19 17:21:57 -07:00
bors 2baabf796c Auto merge of #2240 - RalfJung:readme, r=RalfJung
readme

Emulation of weak memory effects is not a kind of UB, so put it into a separate paragraph. Also remove the note about incomplete threading support. :)
2022-06-19 16:19:48 +00:00
Ralf Jung 3f9414565d readme 2022-06-19 09:18:16 -07:00
bors c4dd3f4ef9 Auto merge of #2228 - cbeuw:futex-fix, r=RalfJung
Prevent futex_wait from actually waiting if a concurrent waker was executed before us

Fixes #2223

Two SC fences were placed in `futex_wake` (after the caller has changed `addr`), and in `futex_wait` (before we read `addr`). This guarantees that `futex_wait` sees the value written to `addr` before the last `futex_wake` call, should one exists, and avoid going into sleep with no one else to wake us up.
https://github.com/rust-lang/miri/blob/ada7b72a879d79aaa06f0a2a95edd520615da1a2/src/concurrency/weak_memory.rs#L324-L326

Earlier I proposed to use `fetch_add(0)` to read the latest value in MO, though this isn't the proper way to do it and breaks aliasing: syscall caller may pass in a `*const` from a `&` and Miri complains about write to a `SharedReadOnly` location, causing this test to fail.
https://github.com/rust-lang/miri/blob/ada7b72a879d79aaa06f0a2a95edd520615da1a2/tests/pass/concurrency/linux-futex.rs#L56-L68
2022-06-18 15:10:56 +00:00
Ralf Jung 737a5b3b98 tweak correctness comment 2022-06-18 07:59:46 -07:00
bors c3a58f1a2d Auto merge of #2239 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/98107
2022-06-18 14:50:15 +00:00
Ralf Jung 735e953853 rustup 2022-06-18 07:49:40 -07:00
bors fa4e77c9fd Auto merge of #2237 - RalfJung:ice, r=oli-obk
add ICE error level

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

But I am not sure if anything else should be adjusted when adding a new error level...
2022-06-16 20:26:12 +00:00
bors ab6f509ba7 Auto merge of #2236 - RalfJung:rustup, r=RalfJung
rustup

I feel like tests became a *lot* slower. I am not sure what is going on and don't have time to debug right now.
2022-06-16 18:18:39 +00:00
Ralf Jung d194e9823c rustup 2022-06-16 11:18:09 -07:00
Ralf Jung e70c631a3b add ICE error level 2022-06-16 11:03:39 -07:00
Andy Wang 807a19a50a Elaborate correctness comments 2022-06-15 01:44:32 +01:00
Andy Wang 56a4c132b6 Reduce the number of iterations 2022-06-13 18:24:19 +01:00
bors e7507d6720 Auto merge of #2207 - RalfJung:ui_test_parallelism, r=oli-obk
ui_test: ensure all worker threads stay around

Also organize files such that the by far slowest test (weak_memory/consistency) always starts first. It still finishes last on my system... even after I halved the iteration count.

Fixes https://github.com/rust-lang/miri/issues/2204
2022-06-13 16:08:54 +00:00
Oli Scherer c16c45362c Document file sorting 2022-06-13 09:08:14 -07:00
Ralf Jung 8ebdad0615 organize more files into folders, and run the weak-mem consistency test as the very first since it is so slow 2022-06-13 09:08:14 -07:00
Ralf Jung a2cc014231 test files in a deterministic order 2022-06-13 09:07:02 -07:00
Ralf Jung 0648f03133 ensure all worker threads stay around 2022-06-13 09:07:02 -07:00
bors 4c1f50bf2b Auto merge of #2232 - rust-lang:gesundheit, r=oli-obk
Always show stderr on test failure.

fixes #2224

I overengineered the original thing to the point where it became fragile. Let's just always print stderr, unless it was already printed
2022-06-13 13:44:16 +00:00
bors 9642534a33 Auto merge of #2179 - RalfJung:rustc, r=oli-obk
test ui output also in rustc test suite

`@oli-obk` when I just tried this locally (`./x.py test src/tools/miri --stage 0`), it worked fine. What differences had you seen before?
2022-06-13 13:13:29 +00:00
bors 2bbb70f584 Auto merge of #2203 - RalfJung:deprecate, r=oli-obk
deprecate -Zmiri-allow-uninit-numbers and -Zmiri-allow-ptr-int-transmute

Cc https://github.com/rust-lang/miri/issues/2187 https://github.com/rust-lang/miri/issues/2188
2022-06-13 10:23:42 +00:00
Oli Scherer 0689f36a55 Always show stderr on test failure. 2022-06-13 08:55:34 +00:00
bors 0a2a4b3742 Auto merge of #2230 - scottmcm:master, r=RalfJung
Add `#![feature(yeet_expr)]`

Hopefully enough for https://github.com/rust-lang/rust/issues/98036
2022-06-13 04:43:28 +00:00
Scott McMurray 238bbd63ab Add #![feature(yeet_expr)] 2022-06-12 18:39:44 -07:00
bors 21399ff065 Auto merge of #2229 - DrMeepster:patch-1, r=RalfJung
Add cache location on windows to documentation
2022-06-13 01:06:22 +00:00
DrMeepster 286a30fb1d correct the path 2022-06-12 12:10:13 -07:00
bors 03a05ae211 Auto merge of #2195 - RalfJung:vtable-validation, r=RalfJung
test for Stacked Borrows error during vtable validation

Fixes https://github.com/rust-lang/miri/issues/2123
Needs https://github.com/rust-lang/rust/pull/97761
2022-06-12 05:34:22 +00:00
Ralf Jung 6ed05d976e bless 2022-06-11 22:34:01 -07:00
Ralf Jung 4ccd3f860a tweak punctuation 2022-06-11 17:45:33 -07:00
Ralf Jung d9f8312d9a rustup 2022-06-11 17:42:53 -07:00