Commit Graph

260593 Commits

Author SHA1 Message Date
bors 03c2100ded Auto merge of #126606 - zachs18:patch-2, r=joboet
Guard against calling `libc::exit` multiple times on Linux.

Mitigates (but does not fix) #126600 by ensuring only one thread which calls Rust `exit` actually calls `libc::exit`, and all other callers of Rust `exit` block.
2024-07-13 01:18:59 +00:00
Michael Howell 42ee400b0f Move assertion-free rustdoc ice tests to rustdoc-ui 2024-07-12 18:18:30 -07:00
Michael Goulet 938ed369ad Gate the type length limit check behind a nightly flag 2024-07-12 21:16:09 -04:00
Michael Howell 17419f6499 rustdoc: rename `issue-\d+.rs` tests to have meaningful names 2024-07-12 18:14:37 -07:00
Michael Howell 4d35754c46 Add URL and crate_name to test cases 2024-07-12 17:36:21 -07:00
Spencer 163d98b2ea Updated slice documentation 2024-07-12 18:09:44 -06:00
bors 336e89bd15 Auto merge of #127665 - workingjubilee:rollup-g90yr21, r=workingjubilee
Rollup of 11 pull requests

Successful merges:

 - #126502 (Ignore allocation bytes in some mir-opt tests)
 - #126922 (add lint for inline asm labels that look like binary)
 - #127209 (Added the `xop` target-feature and the `xop_target_feature` feature gate)
 - #127310 (Fix import suggestion ice)
 - #127338 (Migrate `extra-filename-with-temp-outputs` and `issue-85019-moved-src-dir` `run-make` tests to rmake)
 - #127381 (Migrate `issue-83045`, `rustc-macro-dep-files` and `env-dep-info` `run-make` tests to rmake)
 - #127535 (Fire unsafe_code lint on unsafe extern blocks)
 - #127619 (Suggest using precise capturing for hidden type that captures region)
 - #127631 (Remove `fully_normalize`)
 - #127632 (Implement `precise_capturing` support for rustdoc)
 - #127660 (Rename the internal `const_strlen` to just `strlen`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-12 22:59:30 +00:00
Ben Kimock 7fc69436a1 Use ManuallyDrop in BufWriter::into_parts 2024-07-12 17:15:50 -04:00
Jubilee 8f8734c67a
Rollup merge of #127660 - tgross35:const_strlen-rename, r=dtolnay
Rename the internal `const_strlen` to just `strlen`

Since the libs and lang teams completed an FCP to allow for const `strlen` ([1]), currently implemented with `const_eval_select`, there is no longer any reason to avoid this specific function or use it only in const.

Rename it to reflect this status change.

[1]: https://github.com/rust-lang/rust/issues/113219#issuecomment-2016939401
2024-07-12 13:47:11 -07:00
Jubilee c0d949909f
Rollup merge of #127632 - compiler-errors:precise-capturing-rustdoc, r=fmease
Implement `precise_capturing` support for rustdoc

Implements rustdoc (+json) support for local (i.e. non-cross-crate-inlined) RPITs with `use<...>` precise capturing syntax.

Tests kinda suck. They're really hard to write 😰

r? `@fmease` or re-roll if you're too busy!
also cc `@aDotInTheVoid` for the json side

Tracking:
* https://github.com/rust-lang/rust/issues/127228#issuecomment-2201443216 (not fully fixed for cross-crate-inlined opaques)
* https://github.com/rust-lang/rust/issues/123432
2024-07-12 13:47:10 -07:00
Jubilee 4bfc10617a
Rollup merge of #127631 - compiler-errors:yeet-fully-norm, r=lcnr
Remove `fully_normalize`

Yeet this function and replace it w/ some `ObligationCtxt` instead. It wasn't called very often anyways.

r? lcnr
2024-07-12 13:47:09 -07:00
Jubilee 20cf4eb3b0
Rollup merge of #127619 - compiler-errors:precise-capturing-better-sugg, r=oli-obk
Suggest using precise capturing for hidden type that captures region

Adjusts the "add `+ '_`" suggestion for opaques to instead suggest adding or reusing the `+ use<>` in the opaque.

r? oli-obk or please re-roll if you're busy!
2024-07-12 13:47:09 -07:00
Jubilee 2e0591b1e9
Rollup merge of #127535 - spastorino:unsafe_code-unsafe_extern_blocks, r=oli-obk
Fire unsafe_code lint on unsafe extern blocks

Fixes #126738
2024-07-12 13:47:08 -07:00
Jubilee 38c314e29d
Rollup merge of #127381 - Oneirical:testalt-consciousness, r=jieyouxu
Migrate `issue-83045`, `rustc-macro-dep-files` and `env-dep-info` `run-make` tests 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).

Please try on musl.

try-job: dist-x86_64-musl
2024-07-12 13:47:08 -07:00
Jubilee 6cdef05a71
Rollup merge of #127338 - Oneirical:ready-your-arbatests, r=jieyouxu
Migrate `extra-filename-with-temp-outputs` and `issue-85019-moved-src-dir` `run-make` tests 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).

Please try:

try-job: armhf-gnu
// try-job: test-various // already tried
try-job: x86_64-msvc
try-job: aarch64-apple
2024-07-12 13:47:07 -07:00
Jubilee afb2fbf692
Rollup merge of #127310 - chenyukang:yukang-fix-suggest-import-ice, r=estebank
Fix import suggestion ice

Fixes #127302

#127302 only crash in edition 2015
#120074 can only reproduced in edition 2021
so I added revisions in test file.
2024-07-12 13:47:07 -07:00
Jubilee a6a7129827
Rollup merge of #127209 - sayantn:xop, r=Amanieu
Added the `xop` target-feature and the `xop_target_feature` feature gate

This is an effort towards #127208. This adds the `xop` target feature gated by `xop_target_feature`.
2024-07-12 13:47:06 -07:00
Jubilee fc0136e4f4
Rollup merge of #126922 - asquared31415:asm_binary_label, r=estebank
add lint for inline asm labels that look like binary

fixes #94426

Due to a bug/feature in LLVM, labels composed of only the digits `0` and `1` can sometimes be confused with binary literals, even if a binary literal would not be valid in that position.

This PR adds detection for such labels and also as a drive-by change, adds a note to cases such as `asm!(include_str!("file"))` that the label that it found came from an expansion of a macro, it wasn't found in the source code.

I expect this PR to upset some people that were using labels `0:` or `1:` without issue because they never hit the case where LLVM got it wrong, but adding a heuristic to the lint to prevent this is not feasible - it would involve writing a whole assembly parser for every target that we have assembly support for.

[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202024-06-20/near/445870628)

r? ``@estebank``
2024-07-12 13:47:05 -07:00
Jubilee 5d56572f06
Rollup merge of #126502 - cuviper:dump-mir-exclude-alloc-bytes, r=estebank
Ignore allocation bytes in some mir-opt tests

This adds `rustc -Zdump-mir-exclude-alloc-bytes` to skip writing allocation bytes in MIR dumps, and applies it to tests that were failing on s390x due to its big-endian byte order.

Fixes #126261
2024-07-12 13:47:05 -07:00
bors c6727fc9b5 Auto merge of #123351 - beetrees:x86-ret-snan-rust, r=nikic,workingjubilee
Ensure floats are returned losslessly by the Rust ABI on 32-bit x86

Solves #115567 for the (default) `"Rust"` ABI. When compiling for 32-bit x86, this PR changes the `"Rust"` ABI to return floats indirectly instead of in x87 registers (with the exception of single `f32`s, which this PR returns in general purpose registers as they are small enough to fit in one). No change is made to the `"C"` ABI as that ABI requires x87 register usage and therefore will need a different solution.
2024-07-12 20:36:43 +00:00
Nikita Popov 8dfd3a455d Remove LLVMRustDIBuilderInsertDeclareAtEnd return value
The return value changed from an Instruction to a DbgRecord in
LLVM 19. As we don't actually use the result, drop the return
value entirely to support both.
2024-07-12 22:15:10 +02:00
Nikita Popov 776b0adaaf Fix incorrect NDEBUG handling in LLVM bindings
We currently compile our LLVM bindings using `-DNDEBUG` if
debuginfo for LLVM is disabled. However, `NDEBUG` doesn't have
any relation to debuginfo, it controls whether assertions are
enabled.

Rename the environment variable to `LLVM_ASSERTIONS` and drive
it using the `llvm_assertions` option. Also drop the explicit
`debug(false)` call, as cc already sets this up using the
cargo `DEBUG` environment variable.
2024-07-12 22:13:56 +02:00
Jakub Beránek 72c354094d
Test `build_helper` with the stage 0 compiler
There is no need to build a stage N toolchain for testing it.
2024-07-12 20:15:20 +02:00
Jakub Beránek 823ea0e987
Modify FIXME comment 2024-07-12 20:15:19 +02:00
Jakub Beránek 1089de4339
Simplify command executions for plain source tarballs
If we're in dry run mode, the command will return an empty string, so we can just execute it.
2024-07-12 20:15:19 +02:00
Jakub Beránek 0cab9626f4
Disarm drop bombs for unexecuted test Cargo commands
The code for running tests uses a custom command machinery because it streams the output of the command. We thus need to mark the command as executed in a dry run, to avoid a drop bomb panic.
2024-07-12 20:15:19 +02:00
Jakub Beránek ebb3089038
Remove unused rustdoc command 2024-07-12 20:15:19 +02:00
Jakub Beránek 8ee18d600f
Fix a case where a RustBook command is potentially not executed
We can move the command creation to a block where it is clear that the command will be executed.
2024-07-12 20:15:19 +02:00
Jakub Beránek 9634633889
Improve error message of drop bombs 2024-07-12 20:15:19 +02:00
Jakub Beránek fdf1477221
Improve the `Debug` representation of `BootstrapCommand`
Avoid printing useless information in the `Debug` output.
2024-07-12 20:15:19 +02:00
Jakub Beránek 542344f5bb
Print command creation and execution location when it fails
This should make it quicker to debug command failures.
2024-07-12 20:15:19 +02:00
Jakub Beránek cefd5b3834
Add `DropBomb` to `BootstrapCommand`
This makes it harder to accidentally forget to execute a created command in bootstrap.
2024-07-12 20:15:19 +02:00
Jakub Beránek a1626d709c
Make `command` field of `BootstrapCommand` private to force access to it through the `as_command_mut` method
This will be useful for disarming drop bombs when the inner command is accessed.
2024-07-12 20:15:17 +02:00
Jakub Beránek 042473fd13
Store full arm location in `DropBomb`
Before, only the line was stored. This was enough for run-make tests, since these mostly only contain a single `rmake.rs` file, but not for bootstrap.
2024-07-12 20:14:38 +02:00
Jakub Beránek 49f54b8ee8
Configure test execution for the `build_helper` crate in bootstrap
To enable the previously moved `DropBomb` tests.
2024-07-12 20:14:37 +02:00
Jakub Beránek 97990a4759
Move `DropBomb` from `run-make-support` to `build_helper`
So that it can be also used in bootstrap.
2024-07-12 20:14:37 +02:00
Eduardo Sánchez Muñoz a45c12cf0f Stabilize io_slice_advance 2024-07-12 20:09:29 +02:00
sayantn 1fd0311eab Added the `xop` target feature and `xop_target_feature` gate 2024-07-12 23:30:22 +05:30
Trevor Gross 2772f89797 Rename the internal `const_strlen` to just `strlen`
Since the libs and lang teams completed an FCP to allow for const
`strlen` ([1]), currently implemented with `const_eval_select`, there is
no longer any reason to avoid this specific function or use it only in
const.

Rename it to reflect this status change.

[1]: https://github.com/rust-lang/rust/issues/113219#issuecomment-2016939401
2024-07-12 13:53:58 -04:00
bors 62c068feea Auto merge of #127636 - nnethercote:fix-Parser-look_ahead, r=oli-obk
Fix `Parser::look_ahead`

`Parser::look_ahead` has a slow but simple general case, and a fast special case that is hit most of the time. But the special case is buggy and behaves differently to the general case. There are also no unit tests. This PR fixes all of this, resulting in a `Parser::look_ahead` that is equally fast, slightly simpler, more correct, and better tested.

r? `@davidtwco`
2024-07-12 17:28:21 +00:00
jyn 1c8f9bb84d fix interleaved panic output
previously, we only held a lock for printing the backtrace itself. since all threads were printing to the same file descriptor, that meant random output in the default panic hook would be interleaved with the backtrace. now, we hold the lock for the full duration of the hook, and the output is ordered.
2024-07-12 11:52:04 -04:00
Oneirical fe76650144 rewrite env-dep-info to rmake 2024-07-12 10:58:20 -04:00
Oneirical 87c7a42ba9 rewrite rustc-macro-dep-files to rmake 2024-07-12 10:57:58 -04:00
Oneirical f768db6ba6 rewrite and rename issue-83045 to rmake 2024-07-12 10:57:57 -04:00
bors 5d76a13bbe Auto merge of #127653 - matthiaskrgr:rollup-72bqgvp, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #124980 (Generalize `fn allocator` for Rc/Arc.)
 - #126639 (Add AMX target-features and `x86_amx_intrinsics` feature flag)
 - #126827 (Use pidfd_spawn for faster process spawning when a PidFd is requested)
 - #127433 (Stabilize const_cstr_from_ptr (CStr::from_ptr, CStr::count_bytes))
 - #127552 (remove unnecessary `git` usages)
 - #127613 (Update dist-riscv64-linux to binutils 2.40)
 - #127627 (generalize search graph to enable fuzzing)
 - #127648 (Lower timeout of CI jobs to 4 hours)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-12 14:55:25 +00:00
Oneirical c6cdbe635b rewrite and rename issue-85019-moved-src-dir to rmake 2024-07-12 10:45:39 -04:00
Oneirical cef8a044ea rewrite extra-filename-with-temp-outputs to rmake 2024-07-12 10:45:38 -04:00
Matthias Krüger f11c2c8e95
Rollup merge of #127648 - Kobzol:ci-lower-timeout, r=pietroalbini
Lower timeout of CI jobs to 4 hours

The previous value, 10 hours, is unnecessarily long, since most of our jobs finish within 2.5 hours currently. This could help us detect abnormally long CI runs.

r? ``@pietroalbini``
2024-07-12 14:38:01 +02:00
Matthias Krüger 526da2366a
Rollup merge of #127627 - lcnr:rustc_search_graph, r=compiler-errors
generalize search graph to enable fuzzing

I do not believe it to be feasible to correctly implement the search graph without fuzzing. This PR enables this by requiring a fuzzer to only implement three new traits:
- `Cx`: implemented by all `I: Interner`
- `ProofTreeBuilder`: implemented by `struct ProofTreeBuilder<D>` for all `D: SolverDelegate`
- `Delegate`: implemented for a new `struct SearchGraphDelegate<D>` for all `D: SolverDelegate`

It also moves the evaluation cache implementation into `rustc_type_ir`, requiring `Interner` to provide methods to create and access arbitrary `WithDepNode<T>` and to provide mutable access to a given `GlobalCache`. It otherwise does not change the API surface for users of the shared library.

This change should not impact behavior in any way.

r? ``@compiler-errors``
2024-07-12 14:38:00 +02:00
Matthias Krüger f5fa6fb602
Rollup merge of #127613 - nikic:riscv-update, r=cuviper
Update dist-riscv64-linux to binutils 2.40

binutils 2.40 is required by LLVM 19, as older versions do not know about the zmmul extension.

I've had to backport some patches to glibc and gcc as well, as they don't build with binutils 2.40. Alternatively, we could also switch to glibc 2.35 and gcc 10 (I think). I figured we'd want to avoid the glibc version change, but if that's fine for riscv I can go with that instead.

r? `````@cuviper`````

try-job: dist-riscv64-linux
2024-07-12 14:38:00 +02:00