about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-27Rollup merge of #136101 - jieyouxu:away, r=jieyouxuLeón Orell Valerian Liehr-1/+2
triagebot: set myself on vacation Will be back 02-01.
2025-01-27Rollup merge of #136097 - yotamofek:check-len-and-index, r=petrochenkovLeón Orell Valerian Liehr-10/+10
rustc_ast: replace some len-checks + indexing with slice patterns etc.
2025-01-27Rollup merge of #136091 - jieyouxu:core-tracing, r=clubby789León Orell Valerian Liehr-50/+165
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-27Rollup merge of #136079 - RalfJung:compiler-fence-example, r=jhprattLeón Orell Valerian Liehr-13/+13
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-27Rollup merge of #136072 - cyrgani:old-crash-tests, r=WaffleLapkinLeón Orell Valerian Liehr-0/+16
add two old crash tests This is for #108248 and #132826.
2025-01-27Rollup merge of #135635 - tbu-:pr_io_pipe, r=joboetLeón Orell Valerian Liehr-272/+281
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-27Rollup merge of #135158 - FedericoBruzzone:master, r=lukas-codeLeón Orell Valerian Liehr-58/+233
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-27Rollup merge of #126604 - kadiwa4:uplift_double_negation, r=nnethercoteLeón Orell Valerian Liehr-172/+254
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-26compiler_fence: fix exampleRalf Jung-13/+13
2025-01-27Add `TooGeneric` variant to `LayoutError` and emit `Unknown` oneFedericoBruzzone-58/+233
- `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-26Auto merge of #104693 - jhorstmann:use-high-bit-of-mask-for-select, ↵bors-172/+280
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-26Auto merge of #135783 - compiler-errors:cache-in-closure-binder, r=lcnrbors-1/+144
Add cache to `FoldEscapingRegions` Fixes #135780 ty `@lqd` for the tests
2025-01-27triagebot: set myself on vacation许杰友 Jieyou Xu (Joe)-1/+2
2025-01-26Add cache to FoldEscapingRegionsMichael Goulet-1/+144
2025-01-27rustc-dev-guide: update bootstrap tracing docs许杰友 Jieyou Xu (Joe)-32/+58
2025-01-27bootstrap: add more logging许杰友 Jieyou Xu (Joe)-2/+93
2025-01-27bootstrap: adjust config file cascading fallback comment许杰友 Jieyou Xu (Joe)-1/+5
2025-01-27bootstrap: adjust tracing style许杰友 Jieyou Xu (Joe)-11/+6
2025-01-27bootstrap: avoid glob imports in `main` binary许杰友 Jieyou Xu (Joe)-5/+4
2025-01-26rustc_ast: replace some len-checks + indexing with slice patterns etc. 🧹Yotam Ofek-10/+10
2025-01-26Consistently use the most significant bit of vector masksJörn Horstmann-172/+280
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-26Auto merge of #135764 - nikic:llvm-20-test-fixes, r=wesleywiserbors-15/+105
Fix tests on LLVM 20 For sparcv8plus.rs, duplicate the test for LLVM 19 and LLVM 20. LLVM 20 resolves one of the FIXME in the test. For x86_64-bigint-add.rs split the check lines for LLVM 19 and LLVM 20. The difference in codegen here is due to a difference in unroll factor, which I believe is not what the test is interested in. Fixes https://github.com/rust-lang/rust/issues/132957. Fixes https://github.com/rust-lang/rust/issues/133754.
2025-01-26Auto merge of #136087 - jhpratt:rollup-tam1mzn, r=jhprattbors-155/+309
Rollup of 7 pull requests Successful merges: - #133631 (Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only)) - #134358 (compiler: Set `target_abi = "ilp32e"` on all riscv32e targets) - #135812 (Fix GDB `OsString` provider on Windows ) - #135842 (TRPL: more backward-compatible Edition changes) - #135946 (Remove extra whitespace from rustdoc breadcrumbs for copypasting) - #135953 (ci.py: check the return code in `run-local`) - #136019 (Add an `unchecked_div` alias to the `Div<NonZero<_>>` impls) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-26Update `std::io::{pipe, PipeReader, PipeWriter}` docs the new locationTobias Bucher-16/+20
Also create a section "Platform-specific behavior", don't hide required imports for code examples.
2025-01-26Move `std::io::pipe` code into its own fileTobias Bucher-272/+277
2025-01-26implement lint `double_negations`Kalle Wachsmuth-16/+159
2025-01-26remove `clippy::double_neg`Kalle Wachsmuth-146/+93
2025-01-26unrelated cleanupKalle Wachsmuth-10/+2
2025-01-26Auto merge of #135753 - compiler-errors:from-ty-const, r=oli-obkbors-98/+21
Get rid of `mir::Const::from_ty_const` This function is strange, because it turns valtrees into `mir::Const::Value`, but the rest of the const variants stay as type system consts. All of the callsites except for one in `instsimplify` (array length simplification of `ptr_metadata` call) just go through the valtree arm of the function, so it's easier to just create a `mir::Const` directly for those. For the instsimplify case, if we have a type system const we should *keep* having a type system const, rather than turning it into a `mir::Const::Value`; it doesn't really matter in practice, though, bc `usize` has no padding, but it feels more principled.
2025-01-26Rollup merge of #136019 - scottmcm:alias-unchecked-div, r=Mark-SimulacrumJacob Pratt-0/+7
Add an `unchecked_div` alias to the `Div<NonZero<_>>` impls Inspired by https://github.com/rust-lang/libs-team/issues/526, if people are looking for `unchecked_div`, point them to `u32: Div<NonZero<u32>>` and friends which do no runtime checks -- and are safe! -- rather than today's behaviour of [the intrinsic being the top result](https://doc.rust-lang.org/std/?search=unchecked_div). ![image](https://github.com/user-attachments/assets/cf2a3c06-4876-49c1-8e33-64cd431c772a)
2025-01-26Rollup merge of #135953 - cuviper:ci-run-local-fail, r=KobzolJacob Pratt-1/+1
ci.py: check the return code in `run-local` If the run fails, it should report that and return a non-zero exit status. The simplest way to do that is with `run(..., check=True)`, which raises a `CalledProcessError`.
2025-01-26Rollup merge of #135946 - kornelski:rustdoc-path-space, r=notriddleJacob Pratt-8/+5
Remove extra whitespace from rustdoc breadcrumbs for copypasting The docs header used to display [item names with their full path](https://doc.rust-lang.org/1.82.0/std/os/unix/ffi/trait.OsStrExt.html), but a [recent design change](https://doc.rust-lang.org/1.83.0/std/os/unix/ffi/trait.OsStrExt.html) has split the path and added extra styling to it. The problem is the new styling affects how this text is copied to clipboard. I used to copy and paste the paths into `use` statements in the code, but the new styling has extra formatting and whitespace that makes copied text unusable in Rust source code. Instead of: > std::os::unix::ffi::OsStrExt I now get: > std > :: > os > :: > unix > :: > ffi > Trait OsStrExt This change removes extra whitespace from the markup, and removes `display: flex`. Paths (now in small text) are unlikely to be that long to wrap, and even then regular text wrapping should be sufficient.
2025-01-26Rollup merge of #135842 - chriskrycho:trpl-2024-edition-more, r=ehussJacob Pratt-0/+0
TRPL: more backward-compatible Edition changes - Improve the discussion of `unsafe` blocks within `unsafe` functions. - Fix formatting in Appendix A - Incorporate line edits to Chapter 17 from NoStarch.
2025-01-26Rollup merge of #135812 - Walnut356:gdb_osstring, r=Mark-SimulacrumJacob Pratt-1/+1
Fix GDB `OsString` provider on Windows It would throw an exception due to trying to look up `Wtf8Buf.__0`. The field it actually wants is called [`bytes`](https://github.com/rust-lang/rust/blob/b605c65b6eb5fa71783f8e26df69975f9f1680ee/library/std/src/sys_common/wtf8.rs#L134).
2025-01-26Rollup merge of #134358 - workingjubilee:configure-my-riscv-abi, r=fmeaseJacob Pratt-4/+10
compiler: Set `target_abi = "ilp32e"` on all riscv32e targets This allows compile-time configuration based on this. In the near future we should do this across all RISCV targets, probably, but this cfg is essential for building software usable on these targets, and they are tier 3 so it seems less of a concern to tweak their definition thusly.
2025-01-26Rollup merge of #133631 - flba-eb:add_nto_qnx71_iosock_support, r=workingjubileeJacob Pratt-141/+285
Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only) Changes of this pull request: 1. Refactor code for qnx nto targets to share more code in file `nto_qnx.rs` 1. Add support for an additional network stack on nto qnx 7.1. QNX 7.1 supports two network stacks: 1. `io-pkt`, which is default 2. `io-sock`, which is optional on 7.1 but default in QNX 8.0 As one can see in the [io-sock migration notes](https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.io_sock/topic/migrate_app.html), this changes the libc API in a way similar to e.g. linux-gnu vs. linux-musl. This change adds a new target which has a different value for `target_env`, so that e.g. libc can distinguish between both APIs. 2. Add initial support for QNX 8.0, thanks to AkhilTThomas. As it turned out, the problem with forking many processes still exists in QNX 8.0. Because if this, we are now using it for any QNX version (i.e. not check for `target_env` anymore).
2025-01-26Auto merge of #136085 - jhpratt:rollup-dxmb2h2, r=jhprattbors-396/+730
Rollup of 7 pull requests Successful merges: - #133951 (Make the wasm_c_abi future compat warning a hard error) - #134283 (fix(libtest): Deprecate '--logfile') - #135785 (use `PassMode::Direct` for vector types on `s390x`) - #135948 (Update emscripten std tests) - #135951 (Use `fmt::from_fn` in more places in the compiler) - #136031 (Expand polonius MIR dump) - #136032 (Account for mutable borrow in argument suggestion) Failed merges: - #135635 (Move `std::io::pipe` code into its own file) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-25Rollup merge of #136032 - estebank:issue-136028, r=SparrowLiiJacob Pratt-57/+114
Account for mutable borrow in argument suggestion ``` error: value assigned to `object` is never read --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:21:5 | LL | object = &mut object2; | ^^^^^^ | help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object3(object: &mut Object) { LL | LL | let object2 = Object; LL ~ *object = object2; | ``` instead of ``` error: value assigned to `object` is never read --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:21:5 | LL | object = &mut object2; | ^^^^^^ | help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object3(object: &mut mut Object) { LL | LL | let object2 = Object; LL ~ *object = object2; | ``` Fix #136028.
2025-01-25Rollup merge of #136031 - lqd:polonius-debugger-episode-1, r=compiler-errorsJacob Pratt-34/+216
Expand polonius MIR dump This PR starts expanding the polonius MIR: - switches to an HTML file, to show graphs in the same document as the MIR dump, share them more easily since it's a single file that can be hosted as a gist, and also to allow for interactivity in the near future. - adds the regular NLL MIR + polonius constraints - embeds a mermaid version of the CFG, similar to the graphviz one, but that needs a smaller js than `dot`'s emscripten js from graphvizonline [Here's an example](https://gistpreview.github.io/?0c18f2a59b5e24ac0f96447aa34ffe00) of how it looks. --- In future PRs: mermaid graphs of the NLL region graph, of the NLL SCCs, of the polonius localized outlives constraints, and the interactive polonius MIR dump. r? ```@matthewjasper```
2025-01-25Rollup merge of #135951 - yotamofek:use-debug-helpers, r=SparrowLiiJacob Pratt-178/+119
Use `fmt::from_fn` in more places in the compiler Use the unstable functions from #117729 in more places in the compiler, follow up to #135494
2025-01-25Rollup merge of #135948 - bjorn3:update_emscripten_std_tests, r=Mark-SimulacrumJacob Pratt-68/+64
Update emscripten std tests This disables a bunch of emscripten tests that test things emscripten doesn't support and re-enables a whole bunch of tests which now work just fine on emscripten. Tested with `EMCC_CFLAGS="-s MAXIMUM_MEMORY=2GB" ./x.py test library/ --target wasm32-unknown-emscripten`.
2025-01-25Rollup merge of #135785 - folkertdev:s390x-vector-passmode-direct, r=bjorn3Jacob Pratt-3/+154
use `PassMode::Direct` for vector types on `s390x` closes https://github.com/rust-lang/rust/issues/135744 tracking issue: https://github.com/rust-lang/rust/issues/130869 Previously, all vector types were type erased to `Ni8`, now we pass non-wrapped vector types directly. That skips emitting a bunch of casting logic in rustc, that LLVM then has to clean up. The initial LLVM IR is also a bit more readable. This calling convention is tested extensively in `tests/assembly/s390x-vector-abi.rs`, showing that this change has no impact on the ABI in practice. r? ````@taiki-e````
2025-01-25Rollup merge of #134283 - epage:logfile, r=AmanieuJacob Pratt-2/+8
fix(libtest): Deprecate '--logfile' rust-lang/testing-devex-team#9 proposed changing the behavior of `--logfile`. The given reasons were: (1) Bazel can't programmatically process stdout. This seems like a limitation in Bazel and we recommend focusing on that. If we look at the wider Rust ecosystem, Rustc and Cargo don't support any such mechanism and the Cargo team rejected having one. Expecting this in libtest when its not supported elsewhere seems too specialized. (2) Tests that leak out non-programmatic output that intermixes with programmatic output. We acknowledge this is a problem to be evaluated but we need to make sure we are stepping back and gathering requirements, rather than assuming `--logfile` will fit the needs. Independent of the motive, regarding using or changing `--logfile` (1) Most ways to do it would be a breaking change, like if we respect any stable `--format`. As suggested above, we could specialize this to new `--format` values but that would be confusing for some values to apply but not others. (2) Other ways of solving this add new features to lib`test` when we are instead wanting to limit the feature set it has to minimize the compatibility surface that has to be maintained and the burden it would put on third party harnesses which are a focus area. Examples include `--format compact` or a `--log-format` flag (3) The existence of `--logfile` dates back quite a ways (https://github.com/rust-lang/rust/commit/5cc050b265509c19717e11e12dd785d8c73f5b11, rust-lang/rust#2127) and the history gives the impression this more of slipped through rather than being an intended feature (see also https://github.com/rust-lang/rust/pull/82350#discussion_r579732071). Deprecation would better match to how it has been treated. By deprecating this, we do not expect custom test harnesses (rust-lang/testing-devex-team#2) to implement this. T-testing-devex held an FCP for deprecating in rust-lang/testing-devex-team#9 though according to [RFC #3455](https://rust-lang.github.io/rfcs/3455-t-test.html), this is still subject to final approval from T-libs-api. Closes rust-lang/testing-devex-team#9
2025-01-25Rollup merge of #133951 - bjorn3:wasm_c_abi_lint_hard_error, r=workingjubileeJacob Pratt-54/+55
Make the wasm_c_abi future compat warning a hard error This is the next step in getting rid of the broken C abi for wasm32-unknown-unknown. The lint was made deny-by-default in https://github.com/rust-lang/rust/pull/129534 3 months ago. This still keeps the `-Zwasm-c-abi` flag set to `legacy` by default. It will be flipped in a future PR. cc https://github.com/rust-lang/rust/issues/122532
2025-01-26Auto merge of #136070 - matthiaskrgr:rollup-b5enbuz, r=matthiaskrgrbors-962/+1277
Rollup of 7 pull requests Successful merges: - #134300 (remove long-deprecated no-op attributes no_start and crate_id) - #134373 (Improve and expand documentation of pipes) - #135934 (Include missing item in the 1.81 release notes) - #136005 (ports last few library files to new intrinsic style) - #136016 (Improve check-cfg expected names diagnostic) - #136039 (docs: fix typo in std::pin overview) - #136056 (Fix typo in const stability error message) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-25add two old crash testscyrgani-0/+16
2025-01-25Rollup merge of #136056 - fee1-dead-contrib:push-tswyxkywqrtt, r=jieyouxuMatthias Krüger-17/+17
Fix typo in const stability error message
2025-01-25Rollup merge of #136039 - nvanbenschoten:pin-typo, r=AmanieuMatthias Krüger-2/+2
docs: fix typo in std::pin overview Unimportant fix in `std::pin` documentation.
2025-01-25Rollup merge of #136016 - Urgau:check-cfg-allow-test-improv, r=jieyouxuMatthias Krüger-43/+123
Improve check-cfg expected names diagnostic This PR improves the check-cfg `allow-same-level` test by ~~normalizing it's output and by~~ adding more context to the test. It also filters the well known cfgs from the `expected names are` note, as to reduce the size of the diagnostic. Users can still find the full list on the [rustc book](https://doc.rust-lang.org/nightly/rustc/check-cfg.html#well-known-names-and-values), which is reinforced for Cargo users by adding a note in the Cargo check-cfg specific section. Fixes https://github.com/rust-lang/rust/issues/135995 r? `@jieyouxu`
2025-01-25Rollup merge of #136005 - BLANKatGITHUB:library, r=RalfJungMatthias Krüger-677/+957
ports last few library files to new intrinsic style This pr ports the last 2 library files to new intrinsic style this pr is part of issue #132735