Commit Graph

254254 Commits

Author SHA1 Message Date
bors
82a8059755 Auto merge of #3562 - RalfJung:unsupported, r=RalfJung
only show the 'basic API common for this target' message when this is a missing foreign function

Follow-up to https://github.com/rust-lang/miri/pull/3558
2024-05-04 18:58:20 +00:00
Ralf Jung
cdf3f3c202 only show the 'basic API common for this target' message when this is a missing foreign function 2024-05-04 20:56:51 +02:00
Barrett
da961a8b92 fix(docs): Correct Hermit links to loader + 'rusty-demo'
Both are renamed! Sorry for the initial incorrect commit,
but this should correct it. 😄
2024-05-04 13:39:38 -05:00
Barrett
eade8365b1 docs(fix): incorrect Hermit links in the rustc book
the Hermit team seems to have moved from `hermitcore` to
`hermit-os` on GitHub. this change corrects the old links on its
target page.
2024-05-04 13:28:25 -05:00
Ian Douglas Scott
7dc27d596b library/std: Fix build for NetBSD targets with 32-bit c_long
This fixes building `std` for targets like `mipsel-unknown-netbsd`.

If `c_long` is an `i64`, this conversion works with `Into`. But if it's
an `i32`, this failed to convert a `u32` to an `i32`.
2024-05-04 11:27:21 -07:00
bors
d568423a7a Auto merge of #124716 - matthiaskrgr:rollup-ni58ie1, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #122441 (Improve several `Read` implementations)
 - #124584 (Various improvements to entrypoint code)
 - #124699 (Use `unchecked_sub` in `split_at`)
 - #124715 (interpret, miri: uniform treatments of intrinsics/functions with and without return block)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-04 18:18:42 +00:00
Ralf Jung
f0dee6bbe5 some comments or dynamic drop handling 2024-05-04 20:04:01 +02:00
Ralf Jung
86a933a574 interpret: Drop: always evaluate place 2024-05-04 19:59:11 +02:00
Vladimir Makaev
79e09a6fc5 Added an entry for "lldb" in config.example.toml 2024-05-04 17:55:19 +00:00
bors
d0e77727b1 Auto merge of #3561 - RalfJung:rustup, r=RalfJung
Rustup
2024-05-04 17:36:03 +00:00
bors
7eda989cc9 Auto merge of #3557 - RalfJung:getaffinity, r=RalfJung
Move sched_getaffinity back to Linux

This reverts commit c1a3f8576ea12b0bed68ad3dedf4069ca3d9816f. The shim isn't actually useful for anything, and it is untested on FreeBSD. On Linux it exists solely because std and num_cpus are trying this before falling back to `sysconf`, but on FreeBSD that's not how they work, so there's no reason I can see to have this stub shim on FreeBSD.
2024-05-04 17:11:02 +00:00
Ralf Jung
a040df7e4e remove some dead code 2024-05-04 19:09:40 +02:00
Michael Goulet
50338aa59a Record impl args in the proof tree 2024-05-04 12:57:01 -04:00
Michael Goulet
b33599485b Implement do_not_recommend in the new solver 2024-05-04 12:51:10 -04:00
Ralf Jung
c6e273cccd bless and fmt 2024-05-04 18:40:02 +02:00
Ralf Jung
0c989293ce Merge from rustc 2024-05-04 18:37:35 +02:00
Ralf Jung
adb74ae486 Preparing for merge from rustc 2024-05-04 18:37:23 +02:00
Matthias Krüger
743be1e35e
Rollup merge of #124715 - RalfJung:interpret-noreturn, r=compiler-errors
interpret, miri: uniform treatments of intrinsics/functions with and without return block

A long time ago we didn't have a `dest: &MPlaceTy<'tcx, Self::Provenance>` for diverging functions, and since `dest` is used so often we special-cased these non-returning intrinsics and functions so that we'd have `dest` available everywhere else. But this has changed a while ago, now only the return block `ret` is optional, and there's a convenient `return_to_block` function for dealing with the `None` case.

So there no longer is any reason to treat diverging intrinsics/functions any different from those that do return.
2024-05-04 18:36:38 +02:00
Matthias Krüger
a5cc1f663f
Rollup merge of #124699 - scottmcm:split_at_unchecked_should_use_unchecked, r=Nilstrieb
Use `unchecked_sub` in `split_at`

LLVM currently isn't figuring it out on its own, even in the checked version where it hypothetically could.

Before: <https://rust.godbolt.org/z/PEY38YrKs>
```llvm
bb1:                                              ; preds = %start
  %4 = getelementptr inbounds float, ptr %x.0, i64 %n
  %5 = sub i64 %x.1, %n
```

After:
```llvm
bb1:                                              ; preds = %start
  %4 = getelementptr inbounds float, ptr %x.0, i64 %n
  %5 = sub nuw i64 %x.1, %n
```

This is not using the wrapper because there's already a ubcheck covering it, so I don't want this to get a second one once #121571 lands.

---

This is basically the same as #108763, since `split_at` is essentially doing two `get_unchecked`s.
2024-05-04 18:36:38 +02:00
Matthias Krüger
9af1e8ce42
Rollup merge of #124584 - Nilstrieb:entrypointy, r=fee1-dead
Various improvements to entrypoint code

This moves some code around and adds some documentation comments to make it easier to understand what's going on with the entrypoint logic, which is a bit complicated.

The only change in behavior is consolidating the error messages for unix_sigpipe to make the code slightly simpler.
2024-05-04 18:36:37 +02:00
Matthias Krüger
00bc2a425c
Rollup merge of #122441 - a1phyr:improve_read_impls, r=ChrisDenton
Improve several `Read` implementations

- `read_to_end` and `read_to_string` for `Cursor`
- Error on OOM in `read_to_string` of `&[u8]` and `VecDeque<u8>`
- Avoid making the slices contiguous in `VecDeque::read_to_string`
- ~`read_exact` and (unstable) `read_buf_exact` for `Take`~
- ~`read_buf` for `UnixStream` and `&UnixStream`~ (moved to #123084)
- `read_to_end` for `ChildStdErr`
2024-05-04 18:36:37 +02:00
bors
c3f270174c Auto merge of #3560 - RalfJung:sync-check-id, r=RalfJung
sync: better error in invalid synchronization primitive ID

`@devnexen` this should fix the ICE in your PR (but it won't fix the code, it will just report proper UB instead).
2024-05-04 16:30:38 +00:00
Ralf Jung
9503c41ecc also test pthread_condattr_getclock 2024-05-04 18:28:37 +02:00
bors
1a851da73c Auto merge of #124704 - Urgau:fix-ignored-tests-fmt, r=GuillaumeGomez
Fix ignored tests for formatting

This PR fixes the ignored rules in `rustfmt.toml` that were changed in https://github.com/rust-lang/rust/pull/124613 to allow formatting `rmake.rs` but ended up allowing formatting every Rust files in `tests/`.

The fix is a bit involved since we need to workaround a [`.gitignore` pattern limitation](https://git-scm.com/docs/gitignore#_pattern_format):
> An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.

Workaround using https://stackoverflow.com/a/5534865

I tested the fix by changing the formatting in an `rmake.rs` and UI test, and verifying that only the `rmake.rs` files were formatted.

Fixes https://github.com/rust-lang/rust/pull/124613#issuecomment-2094094670
cc `@GuillaumeGomez`
r? `@onur-ozkan`
2024-05-04 16:08:48 +00:00
Ralf Jung
86d7dff0b8 factor some pthread offset into constants 2024-05-04 18:08:41 +02:00
Michael Goulet
6714216eaa Only consider ambiguous goals when finding best obligation for ambiguities 2024-05-04 12:05:36 -04:00
Ralf Jung
98bb8acb5b sync: better error in invalid synchronization primitive ID 2024-05-04 17:52:50 +02:00
Ralf Jung
8e4466497f interpret, miri: uniform treatments of intrinsics/functions with and without return block 2024-05-04 17:39:29 +02:00
Urgau
dcf6853693 Update Cargo diagnostics in check-cfg 2024-05-04 17:26:15 +02:00
bors
37537d1485 Auto merge of #3559 - RalfJung:weak-extern-static, r=RalfJung
add helper function to declare an extern static for a weak symbol

and use it to make `statx` a regular function and get rid of the syscall
2024-05-04 13:22:53 +00:00
Ralf Jung
19aa8a021d make statx a regular function (so we don't need to support the syscall) 2024-05-04 15:21:08 +02:00
Nilstrieb
1572c0dcd7 Various improvements to entrypoint code
This moves some code around and adds some documentation comments to make
it easier to understand what's going on with the entrypoint logic, which
is a bit complicated.

The only change in behavior is consolidating the error messages for
unix_sigpipe to make the code slightly simpler.
2024-05-04 14:48:42 +02:00
Ralf Jung
823e31d9fa add helper function to declare an extern static for a weak symbol 2024-05-04 14:42:58 +02:00
bors
d7ea27808d Auto merge of #124703 - matthiaskrgr:rollup-2lljptd, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #123356 (Reduce code size of `thread::set_current`)
 - #124159 (Move thread parking to `sys::sync`)
 - #124293 (Let miri and const eval execute intrinsics' fallback bodies)
 - #124677 (Set non-leaf frame pointers on Fuchsia targets)
 - #124692 (We do not coerce `&mut &mut T -> *mut mut T`)
 - #124698 (Rewrite `rustdoc-determinism` test in Rust)
 - #124700 (Remove an unnecessary cast)
 - #124701 (Docs: suggest `uN::checked_sub` instead of check-then-unchecked)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-04 12:41:40 +00:00
bors
3a6faee1e2 Auto merge of #3554 - RalfJung:freebsd, r=RalfJung
document unofficially supported OSes

Also tweak the freeBSD testing a bit.
2024-05-04 12:33:22 +00:00
bors
fd15dc391b Auto merge of #3558 - RalfJung:unsupported, r=RalfJung
update 'unsupported' message

Instead of "the interpreter", just say Miri.

Also be a more more clear about what is expected to be supported and what not (Cc https://github.com/rust-lang/miri/issues/2325).
2024-05-04 12:07:24 +00:00
Ralf Jung
05e7850d7a make some tests not need output (so they work on wasm) 2024-05-04 14:07:17 +02:00
Ralf Jung
38598e68c5 document unofficially supported OSes 2024-05-04 14:07:17 +02:00
Ralf Jung
6df585ade5 freebsd: test std threadname and fs APIs
also reorder foreign_items to fix the grouping, and reorder the tests_minimal invocations to be more consistent
2024-05-04 14:07:17 +02:00
Ralf Jung
8b4b259da2 update 'unsupported' message 2024-05-04 13:45:54 +02:00
Ralf Jung
e1c3d67d21 Revert "moving out sched_getaffinity interception from linux'shim, FreeBSD supporting it too."
This reverts commit c1a3f8576ea12b0bed68ad3dedf4069ca3d9816f.
2024-05-04 13:36:39 +02:00
bors
49cd705189 Auto merge of #3552 - RalfJung:ci, r=RalfJung
even out CI runner times
2024-05-04 11:18:42 +00:00
bors
9d4eea1369 Auto merge of #3556 - RalfJung:intrinsics, r=RalfJung
move intrinsics tests into dedicated folder

And separate them from "shims" (which are for extern functions we link against).
2024-05-04 10:48:35 +00:00
Ralf Jung
52bf84f3cf move some minimal targets over to the macOS runner, to even out CI times 2024-05-04 12:43:48 +02:00
Ralf Jung
a4355bbbb1 fix grouping of target-specific LLVM shims 2024-05-04 12:39:37 +02:00
Urgau
f43e3e2023 Fix ignored tests for formatting 2024-05-04 12:37:30 +02:00
Matthias Krüger
5f4f4fbb98
Rollup merge of #124701 - scottmcm:unchecked_sub_docs, r=Nilstrieb
Docs: suggest `uN::checked_sub` instead of check-then-unchecked

As of #124114 it's exactly the same in codegen, so might as well not use `unsafe`.

Note that this is only for *unsigned*, since the overflow conditions for `iN::checked_sub` are more complicated.
2024-05-04 12:37:24 +02:00
Matthias Krüger
770567101c
Rollup merge of #124700 - scottmcm:unneeded_cast, r=Nilstrieb
Remove an unnecessary cast

Very minor thing, obviously, but I randomly saw this unnecessary cast showing up in the UbChecks, so might as well get rid of it.
2024-05-04 12:37:24 +02:00
Matthias Krüger
b8711373cd
Rollup merge of #124698 - JoverZhang:test-rustdoc-determinism, r=jieyouxu
Rewrite `rustdoc-determinism` test in Rust

Rewrite the `rustdoc-determinism` test from #121876.

r? `@jieyouxu`
2024-05-04 12:37:23 +02:00
Matthias Krüger
b0715b4e57
Rollup merge of #124692 - workingjubilee:document-no-double-pointer-coercion-happens, r=compiler-errors
We do not coerce `&mut &mut T -> *mut mut T`

Resolves #34117 by declaring it to be "working as intended" until someone RFCs it or whatever other lang proposal would be required. It seems a bit of a footgun, but perhaps there are strong reasons to allow it anyways. Seeing as how I often have to be mindful to not allow a pointer to coerce the wrong way in my FFI work, I am inclined to think not, but perhaps it's fine in some use-case and that's actually more common?
2024-05-04 12:37:23 +02:00