Commit Graph

263806 Commits

Author SHA1 Message Date
Ralf Jung
bd4ef64a60 run TLS tests on Solarish 2024-08-17 16:44:05 +02:00
Ralf Jung
34e8245e4c tls_leak_main_thread_allowed: make test check target_thread_local 2024-08-17 16:41:53 +02:00
bors
0058752986 Auto merge of #3819 - RalfJung:epoll-test, r=RalfJung
epoll test: further clean up check_epoll_wait

Given that `check_epoll_wait` compared the length of the two slices, I don't think it was possible for it to ever return `false`. It's also strange to have some requirements checked inside the function and some checked by the caller, so let's just move it all inside the function.

Cc `@tiif` -- did I miss anything?
2024-08-17 10:24:29 +00:00
bors
a4222b97ca Auto merge of #3815 - RalfJung:pipe, r=RalfJung
implement pipe and pipe2

Fixes https://github.com/rust-lang/miri/issues/3746
2024-08-17 09:59:37 +00:00
Ralf Jung
465df5656f epoll test: further clean up check_epoll_wait 2024-08-17 11:47:29 +02:00
bors
db9a97fbb0 Auto merge of #3817 - rust-lang:rustup-2024-08-17, r=RalfJung
Automatic Rustup
2024-08-17 09:33:36 +00:00
Ralf Jung
02a11668a3 SocketPair -> AnonSocket, because a single FD is not a pair 2024-08-17 11:32:19 +02:00
Ralf Jung
5d59bdefb4 test cleanup 2024-08-17 11:32:18 +02:00
Ralf Jung
5402be8f99 socketpair: test behavior when one end got closed 2024-08-17 11:32:18 +02:00
Ralf Jung
99d742e9b0 implement pipe and pipe2 2024-08-17 11:32:17 +02:00
bors
78dfb8a108 Auto merge of #3814 - tiif:epollhup, r=RalfJung
Add epoll EPOLLHUP flag support

Related discussion in https://github.com/rust-lang/miri/issues/3811#issuecomment-2293854742.

This PR added support for ``EPOLLHUP`` flag.
2024-08-17 08:57:07 +00:00
Ralf Jung
cab81d3fa9
extend comments on HUP vs RDHUP 2024-08-17 10:36:46 +02:00
bors
94e57fcf54 Auto merge of #3807 - RalfJung:projects, r=oli-obk
add 'project' process guidlines for larger contributions

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

I am honestly not entirely sure what the consensus from what issue was. I feel like the epoll PR worked reasonably well, and not having been closely involved I am not sure which process `@oli-obk` followed there. Compared to the first draft in #3443 I tried to make this less formal and framed more as guidelines than hard rules.
2024-08-17 08:30:56 +00:00
The Miri Cronjob Bot
dc0faecfcf Merge from rustc 2024-08-17 05:02:50 +00:00
The Miri Cronjob Bot
23b57e8994 Preparing for merge from rustc 2024-08-17 04:54:54 +00:00
tiif
f9a7d6ec6f Move epoll_ready_events.epollhup = true up 2024-08-17 12:02:23 +08:00
bors
f24a6ba06f Auto merge of #106943 - mina86:exact_size_take_repeat, r=dtolnay
Implement DoubleEnded and ExactSize for Take<Repeat> and Take<RepeatWith>

Repeat iterator always returns the same element and behaves the same way
backwards and forwards.  Take iterator can trivially implement backwards
iteration over Repeat inner iterator by simply doing forwards iteration.

DoubleEndedIterator is not currently implemented for Take<Repeat<T>>
because Repeat doesn’t implement ExactSizeIterator which is a required
bound on DEI implementation for Take.

Similarly, since Repeat is an infinite iterator which never stops, Take
can trivially know how many elements it’s going to return.  This allows
implementing ExactSizeIterator on Take<Repeat<T>>.

While at it, observe that ExactSizeIterator can also be implemented for
Take<RepeatWhile<F>> so add that implementation too.  Since in contrast
to Repeat, RepeatWhile doesn’t guarante to always return the same value,
DoubleEndedIterator isn’t implemented.

Those changes render core::iter::repeat_n somewhat redundant.

Issue: https://github.com/rust-lang/rust/issues/104434
Issue: https://github.com/rust-lang/rust/issues/104729

- [ ] ACP: https://github.com/rust-lang/libs-team/issues/120 (this is actually ACP for repeat_n but this is nearly the same functionality so hijacking it so both approaches can be discussed in one place)
2024-08-17 01:46:24 +00:00
bors
67d09736ea Auto merge of #116528 - daxpedda:stabilize-ready-into-inner, r=dtolnay
Stabilize `Ready::into_inner()`

This PR stabilizes `Ready::into_inner()`.

Tracking issue: #101196.
Implementation PR: #101189.

Closes #101196.
2024-08-16 23:20:38 +00:00
bors
506052d49d Auto merge of #129162 - matthiaskrgr:rollup-r0oxdev, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #128990 (Re-enable more debuginfo tests on freebsd)
 - #129042 (Special-case alias ty during the delayed bug emission in `try_from_lit`)
 - #129086 (Stabilize `is_none_or`)
 - #129149 (Migrate `validate_json.py` script to rust in `run-make/rustdoc-map-file` test)
 - #129154 (Fix wrong source location for some incorrect macro definitions)
 - #129161 (Stabilize std:🧵:Builder::spawn_unchecked)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-16 20:19:00 +00:00
tiif
0951107881 Add epoll EPOLLHUP flag support 2024-08-17 02:08:31 +08:00
Matthias Krüger
a9bf86a5f2
Rollup merge of #129161 - dtolnay:spawnunck, r=Noratrieb
Stabilize std:🧵:Builder::spawn_unchecked

Closes #55132.
2024-08-16 19:59:00 +02:00
Matthias Krüger
5bceee4762
Rollup merge of #129154 - wafarm:fix-95463, r=estebank
Fix wrong source location for some incorrect macro definitions

Fixes #95463

Currently the code will consume the next token tree after `var` when trying to parse `$var:some_type` even when it's not a `:` (e.g. a `$` when input is `($foo $bar:tt) => {}`). Additionally it will return the wrong span when it's not a `:`.

This PR fixes these problems.
2024-08-16 19:58:59 +02:00
Matthias Krüger
7177a0eeef
Rollup merge of #129149 - GuillaumeGomez:migrate-python-script, r=jieyouxu
Migrate `validate_json.py` script to rust in `run-make/rustdoc-map-file` test

This PR fixes the FIXME I added for future-me who become present-me. :')

Since there are multiple `run-make` tests using python scripts, I suppose more of them will migrate to Rust, hence why I added the `jzon` public reexport to the `run-make-support` crate.

cc `@jieyouxu`
r? `@Kobzol`
2024-08-16 19:58:59 +02:00
Matthias Krüger
9d57e46f81
Rollup merge of #129086 - slanterns:is_none_or, r=dtolnay
Stabilize `is_none_or`

Closes: https://github.com/rust-lang/rust/issues/126383.

`@rustbot` label: +T-libs-api

r? libs-api
2024-08-16 19:58:58 +02:00
Matthias Krüger
f04d25fa91
Rollup merge of #129042 - Jaic1:fix-116308, r=BoxyUwU
Special-case alias ty during the delayed bug emission in `try_from_lit`

This PR tries to fix #116308.

A delayed bug in `try_from_lit` will not be emitted so that the compiler will not ICE when it sees the pair `(ast::LitKind::Int, ty::TyKind::Alias)` in `lit_to_const` (called from `try_from_lit`).

This PR is related to an unstable feature `adt_const_params` (#95174).

r? ``@BoxyUwU``
2024-08-16 19:58:58 +02:00
Matthias Krüger
19d32e4e23
Rollup merge of #128990 - saethlin:freebsd-debuginfo-tests, r=compiler-errors
Re-enable more debuginfo tests on freebsd

These ignores are _ancient_, we don't run freebsd tests in CI, and even if we did they'd probably pass because the test suite passes with the latest gdb release on Linux.
2024-08-16 19:58:57 +02:00
bors
569d7e3d15 Auto merge of #128456 - Oneirical:clantestine-operations, r=jieyouxu
Migrate `reproducible-build` `run-make` test to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

This will likely fail. Locally, rustc errors with `linker 'linker' not found` on line 36 while the file exists according to the dir-debug statement before it.

If this gets fixed and the test passes, further developments may include:

- [x] There may be some leftovers from each test - `test_in_tmpdir` may therefore be required.
- [ ] Try jobs on all ignored architectures.
- [x] A potential refactor with a struct and a custom function like #128410 so this isn't just a huge stream of `rfs` and `rustc`. This is a little bit harder to do in this test considering the variability present in each test case.

// try-job: x86_64-msvc // windows jobs passed in a prior run
// try-job: x86_64-mingw
// try-job: i686-msvc
// try-job: i686-mingw
try-job: aarch64-apple
try-job: aarch64-gnu
try-job: armhf-gnu
try-job: test-various
try-job: dist-various-1
2024-08-16 17:53:53 +00:00
David Tolnay
e6ac503ec1
Stabilize std:🧵:Builder::spawn_unchecked 2024-08-16 10:43:47 -07:00
bors
83f1b38082 Auto merge of #3809 - RalfJung:fd-refcell, r=oli-obk
FD: remove big surrounding RefCell, simplify socketpair

A while ago, I added the big implicit RefCell for all file descriptions since it avoided interior mutability in `eventfd`. However, this requires us to hold the RefCell "lock" around the entire invocation of the `read`/`write` methods on an FD, which is not great. For instance, if an FD wants to update epoll notifications from inside its `read`/`write`, it is very crucial that the notification check does not end up accessing the FD itself. Such cycles, however, occur naturally:
- eventfd wants to update notifications for itself
- socketfd wants to update notifications on its "peer", which will in turn check *its* peer to see whether that buffer is empty -- and my peer's peer is myself.

This then also lets us simplify socketpair, which currently holds a weak reference to its peer *and* a weak reference to the peer's buffer -- that was previously needed precisely to avoid this issue.
2024-08-16 16:14:42 +00:00
bors
1a51dd9247 Auto merge of #3754 - Vanille-N:master, r=RalfJung
Make unused states of Reserved unrepresentable

In the [previous TB update](https://github.com/rust-lang/miri/pull/3742) we discovered that the existence of `Reserved + !ty_is_freeze + protected` is undesirable.

This has the side effect of making `Reserved { conflicted: true, ty_is_freeze: false }` unreachable.
As such it is desirable that this state would also be unrepresentable.

This PR eliminates the unused configuration by changing
```rs
enum PermissionPriv {
    Reserved { ty_is_freeze: bool, conflicted: bool },
    ...
}
```
into
```rs
enum PermissionPriv {
    ReservedFrz { conflicted: bool },
    ReservedIM,
    ...
}
```
but this is not the only solution and `Reserved(Activable | Conflicted | InteriorMut)` could be discussed.
In addition to making the unreachable state not representable anymore, this change has the nice side effect of enabling `foreign_read` to no longer depend explicitly on the `protected` flag.

Currently waiting for
- `@JoJoDeveloping` to confirm that this is the same representation of `Reserved` as what is being implemented in simuliris,
- `@RalfJung` to approve that this does not introduce too much overhead in the trusted codebase.
2024-08-16 15:48:55 +00:00
Ralf Jung
883e4773b3 explain the behavior on closed peers 2024-08-16 17:44:01 +02:00
Ralf Jung
9184eb54ea more epoll test cleanup 2024-08-16 16:58:49 +02:00
Ralf Jung
edd1efb136 comment and test regarding notifications on writes that dont change readiness 2024-08-16 16:55:57 +02:00
Ralf Jung
b4ab820e5e epoll test cleanup 2024-08-16 16:55:56 +02:00
Ben Kimock
c6815c04cb Re-enable debuginfo tests on freebsd 2024-08-16 10:37:16 -04:00
Guillaume Gomez
6b1637c477 Reexport serde_json crate from run-make-support to give it access to run-make tests 2024-08-16 16:32:07 +02:00
Guillaume Gomez
a2a4f2bcb5 Migrate validate_json.py script to rust in run-make/rustdoc-map-file test 2024-08-16 16:32:06 +02:00
bors
a73bc4a131 Auto merge of #129068 - cuviper:llvm19rc2, r=compiler-errors
Re-update to LLVM 19 rc2

The update in #128677 was accidentally reverted in #128962.

Fixes #129064
r? nikic
2024-08-16 14:22:33 +00:00
Ralf Jung
34aec7c206 make ecx.check_and_update_readiness a truly private helper function 2024-08-16 16:18:59 +02:00
Ralf Jung
82c39ffda7 buf_has_writer is not needed any more 2024-08-16 16:18:59 +02:00
Ralf Jung
17cfbc6fa3 FD: remove big surrounding RefCell, simplify socketpair 2024-08-16 16:18:59 +02:00
Oneirical
e752410a43 massive refactor of reproducible-build test 2024-08-16 10:10:25 -04:00
Oneirical
3c68b113c0 rewrite reproducible-build to rmake 2024-08-16 10:10:24 -04:00
Wafarm
e03cc14b7a
Fix wrong source location for some incorrect macro definitions 2024-08-16 21:27:06 +08:00
bors
27b93da8de Auto merge of #129052 - onur-ozkan:better-incompatibility-check, r=Kobzol
detect incompatible CI rustc options more precisely

Previously, the logic here was simply checking whether the option was set in `config.toml`. This approach was not manageable in our CI runners as we set so many options in config.toml. In reality, those values are not incompatible since they are usually the same value used to generate the CI rustc. Now, the new logic compares the configuration values with the values used to generate the CI rustc, so we get more precise results and make the process more manageable.

r? Kobzol

Blocker for https://github.com/rust-lang/rust/pull/122709
2024-08-16 11:52:38 +00:00
bors
8fbdc04f1b Auto merge of #128977 - jieyouxu:writable-file, r=Kobzol
Only try to modify file times of a writable file on Windows

Introduces a `set_file_times` helper which opens a given path as a file in r+w mode on Windows and then sets file times. Previously the file was open as read-only for Windows which caused permission errors locally.

This should hopefully make setting file times less error prone, since trying to set file times on read-only file on Windows also happened in #127850.

try-job: dist-loongarch64-musl
try-job: x86_64-msvc
2024-08-16 09:24:17 +00:00
许杰友 Jieyou Xu (Joe)
26fae1ed1c bootstrap: fix trying to modify file times on read-only file on Windows 2024-08-16 06:55:23 +00:00
bors
d626fbdc66 Auto merge of #128913 - saethlin:unignore-debuginfo-tests, r=compiler-errors
Enable debuginfo tests that have been "temporarily disabled" for the past 6 years

The PR history is a bit of a mess because I had to test this a lot with try-jobs, so I'll try to summarize the non-obvious changes here.

A number of tests now have `min-lldb-version: 1800`. Those tests should have gotten an lldb version jump either in https://github.com/rust-lang/rust/pull/124781 or long ago. Note that all such tests with that lldb version requirement do not run in Apple CI.

`tests/debuginfo/drop-locations.rs` is staying disabled for now because gdb doesn't know to stop on the drop calls produced by a `}`: https://github.com/rust-lang/rust/issues/128971

`tests/debuginfo/function-arg-initialization.rs` now has `-Zmir-enable-passes=-SingleUseConsts`; without that we initialize the const before the function prelude: https://github.com/rust-lang/rust/issues/128945

`tests/debuginfo/by-value-non-immediate-argument.rs` fails because we don't generate a function prelude for unused non-immediate arguments, even with all optimizations disabled, and this seems to confuse debuggers on aarch64: https://github.com/rust-lang/rust/issues/128973

`tests/debuginfo/pretty-std.rs` is staying disabled on windows-gnu because our test harness doesn't know how to load our pretty-printers on that target: https://github.com/rust-lang/rust/issues/128981

`tests/debuginfo/method-on-enum.rs` and `tests/debuginfo/option-like-enum.rs` encounter some kind of gdb bug on i686-pc-windows-gnu. I don't know enough about that situation to write a good issue.

I plan on doing more work on this test suite. There's clearly a lot more basic cleanup work to do here.
2024-08-16 06:41:16 +00:00
bors
69e36d65f9 Auto merge of #129143 - workingjubilee:rollup-h0hzumu, r=workingjubilee
Rollup of 9 pull requests

Successful merges:

 - #128064 (Improve docs for Waker::noop and LocalWaker::noop)
 - #128922 (rust-analyzer: use in-tree `pattern_analysis` crate)
 - #128965 (Remove `print::Pat` from the printing of `WitnessPat`)
 - #129018 (Migrate `rlib-format-packed-bundled-libs` and `native-link-modifier-bundle` `run-make` tests to rmake)
 - #129037 (Port `run-make/libtest-json` and `run-make/libtest-junit` to rmake)
 - #129078 (`ParamEnvAnd::fully_perform`: we have an `ocx`, use it)
 - #129110 (Add a comment explaining the return type of `Ty::kind`.)
 - #129111 (Port the `sysroot-crates-are-unstable` Python script to rmake)
 - #129135 (crashes: more tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-16 04:10:41 +00:00
Jubilee
e463490ecf
Rollup merge of #129135 - matthiaskrgr:ITKEEPSCRASHINGAAAAAAAAHH, r=compiler-errors
crashes: more tests

r? ````@jieyouxu````
2024-08-15 18:44:19 -07:00