Commit Graph

6375 Commits

Author SHA1 Message Date
bors
f6641963af Auto merge of #2253 - RalfJung:only-bits, r=oli-obk
fix behavior of only-Nbits comments

Fixes https://github.com/rust-lang/miri/issues/2206
2022-06-22 09:26:44 +00:00
bors
5e584d25ef Auto merge of #2252 - dtolnay-contrib:rustfmt5, r=oli-obk
Format tests with rustfmt (225-275 of 300)

Extracted from #2097.

These cases all involve a line comment at the end of a block that rustfmt has chosen to wrap.

```diff
- unsafe { (*ptr).set(20); } //~ ERROR does not exist in the borrow stack
+ unsafe {
+     (*ptr).set(20);
+ } //~ ERROR does not exist in the borrow stack
```

I have moved all of those comments back onto the same line as the content of the block instead, as was indicated being `@RalfJung's` preference in https://github.com/rust-lang/miri/pull/2097#discussion_r862436672.

```diff
+ unsafe {
+     (*ptr).set(20); //~ ERROR does not exist in the borrow stack
+ }
```
2022-06-22 09:04:44 +00:00
bors
769c6c742a Auto merge of #2254 - dtolnay-contrib:rustfmt6, r=oli-obk
Format tests with rustfmt (276-287 of 299)

Extracted from #2097.

This is one half of the last 24 files (left for last because they require more unique attention than the first 275 "easy" files).

I'll comment below to call attention to cases where I exercised my own judgement in how to format the test.

https://github.com/rust-lang/rustfmt/issues/3255 is especially annoying: rustfmt does not like `…( //` and `…{ //`.
2022-06-22 08:43:33 +00:00
David Tolnay
274085cebd
Manual adjustments 2022-06-21 23:52:24 -07:00
David Tolnay
05893d9026
Bless stderr files after rustfmt 2022-06-21 23:21:37 -07:00
David Tolnay
639f660dde
Manual adjustments 2022-06-21 23:21:12 -07:00
David Tolnay
ba23d37b70
Format tests with rustfmt (288-299 of 299) 2022-06-21 22:58:00 -07:00
David Tolnay
7d09004aee
Format tests with rustfmt (276-287 of 299) 2022-06-21 22:57:47 -07:00
Ralf Jung
7308f8f3cf ui_test: fix behavior of only-Nbits comments 2022-06-21 22:25:09 -07:00
bors
7a1b08e46e Auto merge of #2251 - dtolnay-contrib:rustfmt4, r=RalfJung
Format tests with rustfmt (201-224 of 300)

Extracted from #2097. Last of the easy cases which do not involve moving around a comment.
2022-06-22 04:27:04 +00:00
bors
db0d4b68ba Auto merge of #2241 - RalfJung:extern_static_in_const, r=RalfJung
fix ICE when const refers to extern static

Fixes https://github.com/rust-lang/miri/issues/2234
Needs https://github.com/rust-lang/rust/pull/98099
2022-06-22 04:04:37 +00:00
Ralf Jung
b29a706edd rustup 2022-06-21 21:03:52 -07:00
Ralf Jung
f992099820 fix ICE when const refers to extern static 2022-06-21 21:03:40 -07:00
Ralf Jung
8d1b2ca3ec check that tag_alloc_base_pointer is not called on the wrong things 2022-06-21 21:03:40 -07:00
David Tolnay
f1044d2f77
Bless stderr files after rustfmt 2022-06-21 11:46:10 -07:00
David Tolnay
7326da7ce3
Manual adjustments 2022-06-21 11:46:09 -07:00
David Tolnay
6827ac2f37
Format tests with rustfmt (225-275 of 300) 2022-06-21 11:46:09 -07:00
David Tolnay
7d40530c52
Bless stderr files after rustfmt 2022-06-21 11:32:15 -07:00
David Tolnay
b3a689e008
Manual adjustments 2022-06-21 11:32:14 -07:00
David Tolnay
5490e775df
Format tests with rustfmt (201-224 of 300) 2022-06-21 11:32:06 -07:00
Ralf Jung
1b214a0d12 do not protect SRW items 2022-06-21 09:32:58 -07:00
Ralf Jung
b5bc4e1b0c add tests that fail due to SRW protectors
also do more iterations of weak mem consistency, since now that is no longer the slowest test ;)
2022-06-21 09:32:58 -07:00
Ralf Jung
3348869f42 move nopreempt sync tests to their own file 2022-06-21 09:30:19 -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.
ada7b72a87/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.
ada7b72a87/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