Commit Graph

264400 Commits

Author SHA1 Message Date
Alona Enraght-Moony
321d40f060 rustdoc-json: Clean up serialization and printing. 2024-08-17 11:00:26 +00: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
426a60abc2 Auto merge of #128598 - RalfJung:float-comments, r=workingjubilee
float to/from bits and classify: update for float semantics RFC

With https://github.com/rust-lang/rfcs/pull/3514 having been accepted, it is clear that hardware which e.g. flushes subnormal to zero is just non-conformant from a Rust perspective -- this is a hardware bug, or maybe an LLVM backend bug (where LLVM doesn't lower floating-point ops in a way that they have the standardized behavior). So update the comments here to make it clear that we don't have to do any of this, we're just being nice.

Also remove the subnormal/NaN checks from the (unstable) const-version of to/from-bits; they are not needed since we decided with the aforementioned RFC that it is okay to get a different result at const-time and at run-time.

r? `@workingjubilee` since I think you wrote many of the comments I am editing here.
2024-08-17 09:13:13 +00: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
Ralf Jung
5f33085a7f more clear NAN names and fix broken_floats logic
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2024-08-17 10:26:59 +02:00
Ralf Jung
53e1a2ee46 disable problematic float-conv tests in i586 targets
also fix typo in const-float-bits-conv
2024-08-17 10:26:53 +02:00
Zalathar
3116db669c Port run-make/libtest-json/validate_json.py to Rust
This is a trivial Python script that simply tries to parse each line of stdin
(i.e. the test process output) as JSON, to verify that the overall output is
JSON Lines.

We can perform the same check directly in `rmake.rs` using `serde_json`.
2024-08-17 18:15:38 +10:00
Shina
3c8dad152b Emit an error for invalid use of the linkage attribute 2024-08-17 15:03:20 +09: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
bors
54a50bd86f Auto merge of #129178 - weihanglo:update-cargo, r=weihanglo
Update cargo

8 commits in 2f738d617c6ead388f899802dd1a7fd66858a691..ba8b39413c74d08494f94a7542fe79aa636e1661
2024-08-13 10:57:52 +0000 to 2024-08-16 22:48:57 +0000
- feat(update): Report when incompatible-rust-version packages are selected (rust-lang/cargo#14401)
- test: Migrate old_cargos to snapbox (rust-lang/cargo#14410)
- Correct diagnostic for `TomlDebugInfo` (rust-lang/cargo#14413)
- Add `--lockfile-path` flag (rust-lang/cargo#14326)
- test: Migrate some json tests to snapbox (rust-lang/cargo#14402)
- Implement base paths (RFC 3529) 1/n: path dep and patch support (rust-lang/cargo#14360)
- doc: convert comments to rustdoc in workspace (rust-lang/cargo#14397)
- Fix MSRV for workspace .package and .dependencies (rust-lang/cargo#14400)

r? ghost
2024-08-17 04:11:30 +00:00
tiif
f9a7d6ec6f Move epoll_ready_events.epollhup = true up 2024-08-17 12:02:23 +08:00
binarycat
b3ec296f3d autoformat and remove unit test 2024-08-16 23:25:18 -04: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
Michael Goulet
c8ae02fb84 CFI: Erase regions when projecting ADT to its transparent non-1zst field 2024-08-16 21:33:48 -04:00
Weihang Lo
6c201561ac
Update cargo 2024-08-16 21:18:24 -04:00
Ben Kimock
70320c1936 Enable more debuginfo tests on Windows 2024-08-16 21:14:45 -04:00
beetrees
9bc7cea412
Fix is_val_statically_known for floats 2024-08-17 02:14:23 +01:00
binarycat
12e6389788 bootstrap: improve error recovery flags to curl
alternative to #128459

fixes #110178
2024-08-16 19:30:20 -04: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
68b222ebd9 Auto merge of #13274 - Alexendoo:from-str-radix-10-docs, r=xFrednet
Fix code snippet in from_str_radix_10 docs

`<expression>` was being treated as an opening HTML tag

changelog: none
2024-08-16 20:27:10 +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
Boxy
ed6315b3fe Rewrite get_fn_id_for_return_block 2024-08-16 20:53:13 +01:00
Josh Stone
29017e45a1 mir/pretty: use Option instead of Either<Once, Empty>
`Either` is wasteful for a one-or-none iterator, especially since `Once`
is already an `option::IntoIter` internally. We don't really need any of
the iterator mechanisms in this case, just a single conditional insert.
2024-08-16 12:42:02 -07:00
Michael Goulet
84633f47f6 Simplify cleaning foreign fns in rustdoc 2024-08-16 14:10:06 -04:00
Michael Goulet
d850f85055 Don't ICE on Fn trait error for foreign fn 2024-08-16 14:10:06 -04:00
Michael Goulet
833af65f38 Use FnSig instead of raw FnDecl for ForeignItemKind::Fn 2024-08-16 14:10:06 -04: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
Alex Macleod
c0373616d0 Fix code snippet in from_str_radix_10 docs 2024-08-16 15:28:42 +00:00
Ralf Jung
9184eb54ea more epoll test cleanup 2024-08-16 16:58:49 +02:00