1
Fork 0
Commit graph

279948 commits

Author SHA1 Message Date
Trevor Gross
395f0c9ecd Stabilize const_black_box
This has been unstably const since [1], but a tracking issue was never
created. Per discussion on Zulip [2], there should not be any blockers
to making this const-stable. The function does not provide any
functionality at compile time but does allow code reuse between const-
and non-const functions, so stabilize it here.

[1]: https://github.com/rust-lang/rust/pull/92226
[2]: https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/const_black_box
2025-01-27 07:54:58 +00:00
bors
55459598c2 Auto merge of #136116 - fmease:rollup-c8pk3mj, r=fmease
Rollup of 8 pull requests

Successful merges:

 - #126604 (Uplift `clippy::double_neg` lint as `double_negations`)
 - #135158 (Add `TooGeneric` variant to `LayoutError` and emit `Unknown`)
 - #135635 (Move `std::io::pipe` code into its own file)
 - #136072 (add two old crash tests)
 - #136079 (compiler_fence: fix example)
 - #136091 (Add some tracing to core bootstrap logic)
 - #136097 (rustc_ast: replace some len-checks + indexing with slice patterns etc.)
 - #136101 (triagebot: set myself on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-27 06:54:42 +00:00
Manish Goregaokar
ac805d4a4e
Remove "Known problems" section for borrow_interior_mutable_const (#14078)
Remove "Known problems" section for `borrow_interior_mutable_const`
since issue were fixed some time ago - #6110, #5812

changelog: none
2025-01-27 05:14:57 +00:00
bors
633a3fe36d Auto merge of #135937 - bjorn3:separate_coretests_crate, r=jieyouxu,tgross35
Put the core unit tests in a separate coretests package

Having standard library tests in the same package as a standard library crate has bad side effects. It causes the test to have a dependency on a locally built standard library crate, while also indirectly depending on it through libtest. Currently this works out fine in the context of rust's build system as both copies are identical, but for example in cg_clif's tests I've found it basically impossible to compile both copies with the exact same compiler flags and thus the two copies would cause lang item conflicts.

This PR moves the tests of libcore to a separate package which doesn't depend on libcore, thus preventing the duplicate crates even when compiler flags don't exactly match between building the sysroot (for libtest) and building the test itself. The rest of the standard library crates do still have this issue however.
2025-01-27 03:57:37 +00:00
jyn
97311a8969 Downgrade linker-warnings to allow-by-default
This needs more time to bake before we turn it on. Turning it on early risks people silencing the warning indefinitely, before we have the chance to make it less noisy.
2025-01-26 22:57:20 -05:00
usamoi
05364239a8 fix doc for std::sync::mpmc 2025-01-27 11:42:16 +08:00
León Orell Valerian Liehr
03cc3873d5
Rollup merge of #136101 - jieyouxu:away, r=jieyouxu
triagebot: set myself on vacation

Will be back 02-01.
2025-01-27 04:34:54 +01:00
León Orell Valerian Liehr
ef54721cea
Rollup merge of #136097 - yotamofek:check-len-and-index, r=petrochenkov
rustc_ast: replace some len-checks + indexing with slice patterns etc.
2025-01-27 04:34:53 +01:00
León Orell Valerian Liehr
e72e49a1a8
Rollup merge of #136091 - jieyouxu:core-tracing, r=clubby789
Add some tracing to core bootstrap logic

Follow-up to #135391.

### Summary

Add some initial tracing logging to bootstrap, focused on the core logic (in this PR).

Also:

- Adjusted tracing-tree style to not use indent lines (I found that more distracting than helpful).
- Avoid glob-importing `tracing` items.
- Improve the rustc-dev-guide docs on bootstrap tracing.

### Example output

```bash
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap
```

![Example bootstrap tracing output](https://github.com/user-attachments/assets/0be39042-0822-44b6-9451-30427cfea156)

r? bootstrap
2025-01-27 04:34:53 +01:00
León Orell Valerian Liehr
bd2f6d7ee8
Rollup merge of #136079 - RalfJung:compiler-fence-example, r=jhpratt
compiler_fence: fix example

The old example was wrong, an acquire fence is required in the signal handler. To make the point more clear, I changed the "data" variable to use non-atomic accesses.

Fixes https://github.com/rust-lang/rust/issues/133014
2025-01-27 04:34:52 +01:00
León Orell Valerian Liehr
f7b58ea3e5
Rollup merge of #136072 - cyrgani:old-crash-tests, r=WaffleLapkin
add two old crash tests

This is for #108248 and #132826.
2025-01-27 04:34:52 +01:00
León Orell Valerian Liehr
2949f2a5ef
Rollup merge of #135635 - tbu-:pr_io_pipe, r=joboet
Move `std::io::pipe` code into its own file

Also update the docs for the new location, create a section "Platform-specific behavior", don't hide required imports for code examples.
2025-01-27 04:34:51 +01:00
León Orell Valerian Liehr
b634bb9e7c
Rollup merge of #135158 - FedericoBruzzone:master, r=lukas-code
Add `TooGeneric` variant to `LayoutError` and emit `Unknown`

What's in this PR?

- Add `TooGeneric` variant to `LayoutError` and emit `Unknown` one

With this PR these issues and their respective ICEs are resolved:
- fixes https://github.com/rust-lang/rust/issues/135020
- fixes https://github.com/rust-lang/rust/issues/135138
2025-01-27 04:34:51 +01:00
León Orell Valerian Liehr
c5196736b2 Rollup merge of #126604 - kadiwa4:uplift_double_negation, r=nnethercote
Uplift `clippy::double_neg` lint as `double_negations`

Warns about cases like this:
```rust
fn main() {
    let x = 1;
    let _b = --x; //~ WARN use of a double negation
}
```

The intent is to keep people from thinking that `--x` is a prefix decrement operator. `++x`, `x++` and `x--` are invalid expressions and already have a helpful diagnostic.

I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the `--x` operation. The code that triggers the lint should always be reviewed manually.

Closes #82987
2025-01-27 04:34:50 +01:00
León Orell Valerian Liehr
3c58b2f739
Rollup merge of #126604 - kadiwa4:uplift_double_negation, r=nnethercote
Uplift `clippy::double_neg` lint as `double_negations`

Warns about cases like this:
```rust
fn main() {
    let x = 1;
    let _b = --x; //~ WARN use of a double negation
}
```

The intent is to keep people from thinking that `--x` is a prefix decrement operator. `++x`, `x++` and `x--` are invalid expressions and already have a helpful diagnostic.

I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the `--x` operation. The code that triggers the lint should always be reviewed manually.

Closes #82987
2025-01-27 04:34:50 +01:00
León Orell Valerian Liehr
c38951b280
Make a previously unreachable UI test reachable 2025-01-27 02:28:49 +01:00
León Orell Valerian Liehr
0b18b4fbbc
Remove all dead files inside tests/ui/ 2025-01-27 02:28:04 +01:00
Michael Goulet
c08624d8d2 Remove redundant to_ident_string calls 2025-01-27 01:23:34 +00:00
Michael Goulet
ac1c6c50f4 Use identifiers in diagnostics more often 2025-01-27 01:23:34 +00:00
Huang Qi
ebf53630db Mark all NuttX targets as tier 3 target and support the standard library
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-27 09:23:14 +08:00
Ralf Jung
9c972c0ea5 compiler_fence: fix example 2025-01-26 17:34:33 -07:00
FedericoBruzzone
cef97bce7b Add TooGeneric variant to LayoutError and emit Unknown one
- `check-pass` test for a MRE of #135020
- fail test for #135138
- switch to `TooGeneric` for checking CMSE fn signatures
- switch to `TooGeneric` for compute `SizeSkeleton` (for transmute)
- fix broken tests
2025-01-27 00:37:34 +01:00
Timo
c26985ba80
fixed a missing description of the MSRV option for manual_repeat_n (#14081)
I added `manual_repeat_n` lint before, which has the `MSRV` option.
However, I forgot to add this lint to the lint configuration.

changelog: none
2025-01-26 23:18:24 +00:00
bors
0df0662ee0 Auto merge of #104693 - jhorstmann:use-high-bit-of-mask-for-select, r=workingjubilee
Consistently use the highest bit of vector masks when converting to i1 vectors

This improves the codegen for vector `select`, `gather`, `scatter` and boolean reduction intrinsics and fixes rust-lang/portable-simd#316.

The current behavior of most mask operations during llvm codegen is to truncate the mask vector to <N x i1>, telling llvm to use the least significat bit. The exception is the `simd_bitmask` intrinsics, which already used the most signifiant bit.

Since sse/avx instructions are defined to use the most significant bit, truncating means that llvm has to insert a left shift to move the bit into the most significant position, before the mask can actually be used.

Similarly on aarch64, mask operations like blend work bit by bit, repeating the least significant bit across the whole lane involves shifting it into the sign position and then comparing against zero.

By shifting before truncating to <N x i1>, we tell llvm that we only consider the most significant bit, removing the need for additional shift instructions in the assembly.
2025-01-26 22:45:21 +00:00
Noah Lev
885641bab1
Merge pull request #2223 from marxin/CI-cache-restore-key
CI: use key-restore for cache GH action
2025-01-26 14:21:09 -08:00
Rémy Rakic
6bdc2dc3cf tidy up html structure
- invert pre/code which was an invalid combination, that works fine in
  practice
- remove unneeded code wrapper for graphs
2025-01-26 21:22:46 +00:00
Rémy Rakic
052e9b4306 add NLL SCCs to polonius MIR dump 2025-01-26 21:13:32 +00:00
Rémy Rakic
1ee7582545 add NLL region graph to the polonius MIR dump 2025-01-26 21:12:42 +00:00
Tshepang Mbambo
f6bd61aa71
Merge pull request #2225 from ehuss/patch-3
Correct information on dylib compression
2025-01-26 22:22:47 +02:00
León Orell Valerian Liehr
57b5d3af62
Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
Eric Huss
5210a8d1e9
Correct information on dylib compression
Compression of dylibs was removed in https://github.com/rust-lang/rust/pull/113695 (and decompression removed in https://github.com/rust-lang/rust/pull/132402).
2025-01-26 12:08:48 -08:00
Ralf Jung
05a2dcdbd0
Merge pull request #4154 from RalfJung/linux-futex
make linux-futex test less flaky
2025-01-26 19:58:43 +00:00
bors
f85c6de552 Auto merge of #135783 - compiler-errors:cache-in-closure-binder, r=lcnr
Add cache to `FoldEscapingRegions`

Fixes #135780

ty `@lqd` for the tests
2025-01-26 19:58:17 +00:00
Ralf Jung
584bb0db42
Merge pull request #4153 from Mark-Simulacrum/reduce-symbol-lookups
Pre-intern name when searching module children
2025-01-26 19:57:00 +00:00
lapla-cogito
0b818aa673
fixed a missing description of the MSRV option for manual_repeat_n 2025-01-27 04:54:40 +09:00
Ralf Jung
37030ac279 make linux-futex test less flaky 2025-01-26 12:33:51 -07:00
Mark Rousskov
07de7a4bf9 Pre-intern name when searching module children
This avoids a good deal of work, since each module child can now just be
compared via u32 comparison, rather than fetching the raw &str
(requiring locking and indexing into the interner) and then comparing
the two strings (also relatively expensive).
2025-01-26 14:28:15 -05:00
许杰友 Jieyou Xu (Joe)
504d574bc1 triagebot: set myself on vacation 2025-01-27 02:28:35 +08:00
Michael Goulet
d7a6fdc71f Add cache to FoldEscapingRegions 2025-01-26 18:27:58 +00:00
Alejandra González
057f5b36f5
Make unnecessary_map_or work with ref and Deref to Option/Result (#14024)
Receivers which are references to `Option` and `Result`, or who
implement `Deref` to one of those types, will be linted as well.

changelog: [`unnecessary_map_or`]: work with ref and `Deref` to `Option`
and `Result` as well

Fixes #14023

**Note:** this patch must be merged after #13998 – only the second
commit must be reviewed, the first one repeats the patch in #13998 for
mergeability reasons.
2025-01-26 18:06:49 +00:00
许杰友 Jieyou Xu (Joe)
97efda63b3 rustc-dev-guide: update bootstrap tracing docs 2025-01-27 01:24:53 +08:00
许杰友 Jieyou Xu (Joe)
2e1a5320f5 bootstrap: add more logging 2025-01-27 01:24:53 +08:00
许杰友 Jieyou Xu (Joe)
71703bb7d9 bootstrap: adjust config file cascading fallback comment 2025-01-27 01:24:53 +08:00
许杰友 Jieyou Xu (Joe)
761bda1e43 bootstrap: adjust tracing style 2025-01-27 01:24:53 +08:00
许杰友 Jieyou Xu (Joe)
4febbd5c09 bootstrap: avoid glob imports in main binary 2025-01-27 01:24:53 +08:00
Ralf Jung
ccbfe505f6
Merge pull request #4152 from RalfJung/many-seeds
many-seeds: do not use more than 8 threads
2025-01-26 17:11:49 +00:00
Ralf Jung
d7f165690b many-seeds: do not use more than 8 threads 2025-01-26 09:41:57 -07:00
Ralf Jung
4ce50a3977 many-seeds: in keep-going mode, print how many tests failed 2025-01-26 09:40:16 -07:00
Yotam Ofek
614446887e rustc_ast: replace some len-checks + indexing with slice patterns etc. 🧹 2025-01-26 16:26:52 +00:00
Jörn Horstmann
3779b8e32e Consistently use the most significant bit of vector masks
This improves the codegen for vector `select`, `gather`, `scatter` and
boolean reduction intrinsics and fixes rust-lang/portable-simd#316.

The current behavior of most mask operations during llvm codegen is to
truncate the mask vector to <N x i1>, telling llvm to use the least
significat bit. The exception is the `simd_bitmask` intrinsics, which
already used the most signifiant bit.

Since sse/avx instructions are defined to use the most significant bit,
truncating means that llvm has to insert a left shift to move the bit
into the most significant position, before the mask can actually be
used.

Similarly on aarch64, mask operations like blend work bit by bit,
repeating the least significant bit across the whole lane involves
shifting it into the sign position and then comparing against zero.

By shifting before truncating to <N x i1>, we tell llvm that we only
consider the most significant bit, removing the need for additional
shift instructions in the assembly.
2025-01-26 16:44:23 +01:00