about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-12Update the explanation for why we use box_new in vec!Ben Kimock-2/+2
2025-01-12Auto merge of #135402 - matthiaskrgr:rollup-cz7hs13, r=matthiaskrgrbors-542/+853
Rollup of 6 pull requests Successful merges: - #129259 (Add inherent versions of MaybeUninit methods for slices) - #135374 (Suggest typo fix when trait path expression is typo'ed) - #135377 (Make MIR cleanup for functions with impossible predicates into a real MIR pass) - #135378 (Remove a bunch of diagnostic stashing that doesn't do anything) - #135397 (compiletest: add erroneous variant to `string_enum`s conversions error) - #135398 (add more crash tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-12Auto merge of #135262 - mrkajetanp:ci-aarch64-dist-reland, r=Kobzolbors-95/+134
ci: Move dist-aarch64-linux to an aarch64 runner Move the dist-aarch64-linux CI job to an aarch64 runner instead of cross-compiling it from an x86 one. This will make it possible to perform optimisations such as LTO, PGO and BOLT later on. r? `@Kobzol` Reland of #133809 now that the higher page sizes are fixed. try-job: dist-aarch64-linux try-job: dist-x86_64-linux try-job: dist-i686-linux
2025-01-12Rollup merge of #135398 - matthiaskrgr:crash, r=lqdMatthias Krüger-0/+56
add more crash tests try-job: aarch64-apple try-job: x86_64-msvc try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl
2025-01-12Rollup merge of #135397 - lqd:compiletest-enums, r=jieyouxuMatthias Krüger-3/+34
compiletest: add erroneous variant to `string_enum`s conversions error As requested in #135392, this adds which variant caused the string conversion failure. r? jieyouxu fixes #135392
2025-01-12Rollup merge of #135378 - compiler-errors:unnecessary-stashing, r=chenyukangMatthias Krüger-181/+173
Remove a bunch of diagnostic stashing that doesn't do anything #121669 removed a bunch of conditional diagnostic stashing/canceling, but left around the `steal` calls which just emitted the error eagerly instead of canceling the diagnostic. I think that these no-op `steal` calls don't do much and are confusing to encounter, so let's remove them. The net effect is: 1. We emit more duplicated errors, since stashing has the side effect of duplicating diagnostics. This is not a big deal, since outside of `-Zdeduplicate-diagnostics=no`, the errors are already being deduplicated by the compiler. 2. It changes the order of diagnostics, since we're no longer stashing and then later stealing the errors. I don't think this matters much for the changes that the UI test suite manifests, and it makes these errors less order dependent.
2025-01-12Rollup merge of #135377 - compiler-errors:impossible-step, r=oli-obkMatthias Krüger-46/+99
Make MIR cleanup for functions with impossible predicates into a real MIR pass It's a bit jarring to see the body of a function with an impossible-to-satisfy where clause suddenly go to a single `unreachable` terminator when looking at the MIR dump output in order, and I discovered it's because we manually replace the body outside of a MIR pass. Let's make it into a fully flegded MIR pass so it's more clear what it's doing and when it's being applied.
2025-01-12Rollup merge of #135374 - compiler-errors:typo-trait-method, r=fee1-deadMatthias Krüger-2/+79
Suggest typo fix when trait path expression is typo'ed When users write something like `Default::defualt()` (notice the typo), failure to resolve the erroneous `defualt` item will cause resolution + lowering to interpret this as a type-dependent path whose self type is `Default` which is a trait object without `dyn`, rather than a trait function like `<_ as Default>::default()`. Try to provide a bit of guidance in this situation when we can detect the typo. Fixes https://github.com/rust-lang/rust/issues/135349
2025-01-12Rollup merge of #129259 - clarfonthey:maybe_uninit_slices, r=tgross35Matthias Krüger-310/+412
Add inherent versions of MaybeUninit methods for slices This is my attempt to un-stall #63569 and #79995, by creating methods that mirror the existing `MaybeUninit` API: ```rust impl<T> MaybeUninit<T> { pub fn write(&mut self, value: T) -> &mut T; pub fn as_bytes(&self) -> &[MaybeUninit<u8>]; pub fn as_bytes_mut(&mut self) -> &mut [MaybeUninit<u8>]; pub unsafe fn assume_init_drop(&mut self); pub unsafe fn assume_init_ref(&self) -> &T; pub unsafe fn assume_init_mut(&mut self) -> &mut T; } ``` Adding these APIs: ```rust impl<T> [MaybeUninit<T>] { // replacing copy_from_slice; renamed to avoid conflict pub fn write_copy_of_slice(&mut self, value: &[T]) -> &mut [T] where T: Copy; // replacing clone_from_slice; renamed to avoid conflict pub fn write_clone_of_slice(&mut self, value: &[T]) -> &mut [T] where T: Clone; // identical to non-slice versions; no conflict pub fn as_bytes(&self) -> &[MaybeUninit<u8>]; pub fn as_bytes_mut(&mut self) -> &mut [MaybeUninit<u8>]; pub unsafe fn assume_init_drop(&mut self); pub unsafe fn assume_init_ref(&self) -> &[T]; pub unsafe fn assume_init_mut(&mut self) -> &mut [T]; } ``` Since the `assume_init` methods are identical to those on non-slices, they feel pretty natural. The main issue with the write methods is naming, as discussed in #79995 among other places. My rationale: * The term "write" should be in them somewhere, to mirror the other API, and this pretty much automatically makes them not collide with any other inherent slice methods. * I chose `write_clone_of_slice` and `write_copy_of_slice` since `clone` and `copy` are being used as objects here, whereas they're being used as actions in `clone_from_slice` and `copy_from_slice`. The final "weird" thing I've done in this PR is remove a link to `Vec<T>` from `assume_init_drop` (both copies, since they're effectively copied docs), since there's no good way to link to `Vec` for something that can occur both on the page for `std/primitive.slice.html` and `std/vec/struct.Vec.html`, since the code here lives in libcore and can't use intra-doc-linking to mention `Vec`. (see: #121436) The reason why this method shows up both on `Vec<T>` and `[T]` is because the `[T]` docs are automatically inlined on `Vec<T>`'s page, since it implements `Deref`. It's unfortunate that rustdoc doesn't have a way of dealing with this at the moment, but it is what it is, and it's a reasonable compromise for now.
2025-01-12add more crash testsMatthias Krüger-0/+56
2025-01-12Auto merge of #135396 - matthiaskrgr:rollup-zublg1c, r=matthiaskrgrbors-24/+77
Rollup of 5 pull requests Successful merges: - #135266 (Remove emsdk version update from 1.84.0 relnotes) - #135364 (Cleanup `suggest_binding_for_closure_capture_self` diag in borrowck) - #135375 (allow rustdoc-js tests to be run at stage0) - #135379 (Make (unstable API) `UniqueRc` invariant for soundness) - #135389 (compiletest: include stage0-sysroot libstd dylib in recipe dylib search path) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-12Rollup merge of #135389 - jieyouxu:fix-stage0-rustdoc-rmake, r=onur-ozkanMatthias Krüger-3/+11
compiletest: include stage0-sysroot libstd dylib in recipe dylib search path To fix some of the failures in `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0`. Specifically, ``` COMPILETEST_FORCE_STAGE0=1 ./x test tests/run-make/rustdoc-default-output/ --stage 0 ``` should now pass. Fixes #135373. (As in, make *some* of the `run-make` tests pass, other `run-make` tests fail for various reasons against stage0, and generally `run-make` tests are not guaranteed to pass at stage 0.) cc `@lolbinarycat` r? bootstrap
2025-01-12Rollup merge of #135379 - steffahn:uniquerc-invariant, r=Mark-SimulacrumMatthias Krüger-2/+48
Make (unstable API) `UniqueRc` invariant for soundness Add test case from https://github.com/rust-lang/rust/pull/133572#issuecomment-2543007164 (comment in review of `UniqueArc`), and fix the issue for `UniqueRc`.
2025-01-12Rollup merge of #135375 - lolbinarycat:bootstrap-allow-stage0-rustdoc-js, ↵Matthias Krüger-1/+4
r=jieyouxu allow rustdoc-js tests to be run at stage0 this mirrors the behavior of rustdoc-js-std tests. previously this required COMPILETEST_FORCE_STAGE0.
2025-01-12Rollup merge of #135364 - yotamofek:borrowck-diag-fix, r=compiler-errorsMatthias Krüger-16/+13
Cleanup `suggest_binding_for_closure_capture_self` diag in borrowck Mostly grammar fix/improvement, but also a small cleanup to use iterators instead of for loops for collecting into a vector.
2025-01-12Rollup merge of #135266 - kadiwa4:no_emsdk_update, r=Mark-SimulacrumMatthias Krüger-2/+1
Remove emsdk version update from 1.84.0 relnotes See [this comment](https://github.com/rust-lang/rust/issues/131467#issuecomment-2529314603). The reproducer in that comment does indeed show that rustup's `rust-std` component is still compiled with the old emscripten ABI because libc's config flag `emscripten_new_stat_abi` is not set. #131533 presumably had no effect because the wrong CI file was modified. So nothing has changed since 1.83.0. The PR author (workingjubilee) is currently on vacation. Also the issue #131467 should be reopened.
2025-01-12add error message to `string_enum!`s string conversionsRémy Rakic-4/+4
2025-01-12add test for `string_enum`Rémy Rakic-0/+31
2025-01-12Auto merge of #135322 - scottmcm:inst-simplify-repeat-one, r=oli-obkbors-29/+149
[mir-opt] simplify `Repeat`s that don't actually repeat the operand Created because when I was writing this case in GVN https://github.com/rust-lang/rust/pull/133324/files#diff-292b215fdc6b59e3f3c4173c2270b14591c5673832fbfb05cd69a05c2ef0c30eR977-R979 I happened to notice that it worked for `[x]` but not for `[x; 1]`, so figured it would be good to simplify that `Repeat` to the simpler `Aggregate`.
2025-01-12run-make-support: don't use lossy on `TARGET_RPATH_DIR`许杰友 Jieyou Xu (Joe)-2/+1
2025-01-12compiletest: include stage0-sysroot libstd dylib in recipe dylib search path许杰友 Jieyou Xu (Joe)-1/+10
To fix some of the failures in `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0`.
2025-01-11Add inherent versions of MaybeUninit methods for slicesltdk-310/+412
2025-01-11Address PR feedbackScott McMurray-13/+54
2025-01-11[mir-opt] simplify `Repeat`s that don't actually repeat the operandScott McMurray-23/+102
2025-01-11Auto merge of #135360 - RalfJung:structural-partial-eq, r=compiler-errorsbors-18/+13
update and clarify StructuralPartialEq docs This apparently hasn't been updated when we finalized the current const pattern matching behavior. Fixes https://github.com/rust-lang/rust/issues/92454 by providing rationale and context in the docs linked from that error message.
2025-01-11Make UniqueRc invariant for soundnessFrank Steffahn-2/+48
2025-01-11Make MIR cleanup for functions with impossible predicates into a real MIR passMichael Goulet-46/+99
2025-01-11allow rustdoc-js tests to be run at stage0binarycat-1/+4
this mirrors the behavior of rustdoc-js-std tests. previously this required COMPILETEST_FORCE_STAGE0.
2025-01-11Remove a bunch of diagnostic stashing that doesn't do anythingMichael Goulet-181/+173
2025-01-11Suggest typos when trait path expression is typodMichael Goulet-2/+79
2025-01-11Auto merge of #135370 - matthiaskrgr:rollup-g2w6d5n, r=matthiaskrgrbors-437/+706
Rollup of 4 pull requests Successful merges: - #134030 (add `-Zmin-function-alignment`) - #134776 (Avoid ICE: Account for `for<'a>` types when checking for non-structural type in constant as pattern) - #135205 (Rename `BitSet` to `DenseBitSet`) - #135314 (Eagerly collect mono items for non-generic closures) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-11Rollup merge of #135314 - compiler-errors:eagerly-mono-closures, r=wesleywiserMatthias Krüger-3/+60
Eagerly collect mono items for non-generic closures This allows users to use `-Zprint-mono-items=eager` to eagerly monomorphize closures and coroutine bodies, in case they want to inspect the LLVM or ASM for those items. `-Zprint-mono-items`, which used to be called `-Zprint-trans-items`, was originally added in https://github.com/rust-lang/rust/pull/30900: > Eager mode is meant to be used in conjunction with incremental compilation > where a stable set of translation items is more important than a minimal > one. Thus, eager mode will instantiate drop-glue for every drop-able type > in the crate, even of no drop call for that type exists (yet). It will > also instantiate default implementations of trait methods, something that > otherwise is only done on demand. Although it remains an unstable option, its purpose has somewhat expanded since then, and as far as I can tell it's generally useful for cases when you want to monomorphize as many items as possible, even if they're unreachable. Specifically, it's useful for debugging since you can look at the codegen'd body of a function, since we don't emit items that are not reachable in monomorphization. And even more specifically, it would be very to monomorphize the coroutine body of an async fn, since those you can't easily call those without a runtime. This PR enables this usecase since we now monomorphize `DefKind::Closure`.
2025-01-11Rollup merge of #135205 - lqd:bitsets, r=Mark-SimulacrumMatthias Krüger-380/+397
Rename `BitSet` to `DenseBitSet` r? `@Mark-Simulacrum` as you requested this in https://github.com/rust-lang/rust/pull/134438#discussion_r1890659739 after such a confusion. This PR renames `BitSet` to `DenseBitSet` to make it less obvious as the go-to solution for bitmap needs, as well as make its representation (and positives/negatives) clearer. It also expands the comments there to hopefully make it clearer when it's not a good fit, with some alternative bitsets types. (This migrates the subtrees cg_gcc and clippy to use the new name in separate commits, for easier review by their respective owners, but they can obvs be squashed)
2025-01-11Rollup merge of #134776 - estebank:vanilla-ice, r=lcnrMatthias Krüger-51/+104
Avoid ICE: Account for `for<'a>` types when checking for non-structural type in constant as pattern When we encounter a constant in a pattern, we check if it is non-structural. If so, we check if the type implements `PartialEq`, but for types with escaping bound vars the check would be incorrect as is, so we break early. This is ok because these types would be filtered anyways. Slight tweak to output to remove unnecessary context as a drive-by. Fix #134764.
2025-01-11Rollup merge of #134030 - folkertdev:min-fn-align, r=workingjubileeMatthias Krüger-3/+145
add `-Zmin-function-alignment` tracking issue: https://github.com/rust-lang/rust/issues/82232 This PR adds the `-Zmin-function-alignment=<align>` flag, that specifies a minimum alignment for all* functions. ### Motivation This feature is requested by RfL [here](https://github.com/rust-lang/rust/issues/128830): > i.e. the equivalents of `-fmin-function-alignment` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fmin-function-alignment_003dn), Clang does not support it) / `-falign-functions` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-falign-functions), [Clang](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang1-falign-functions)). > > For the Linux kernel, the behavior wanted is that of GCC's `-fmin-function-alignment` and Clang's `-falign-functions`, i.e. align all functions, including cold functions. > > There is [`feature(fn_align)`](https://github.com/rust-lang/rust/issues/82232), but we need to do it globally. ### Behavior The `fn_align` feature does not have an RFC. It was decided at the time that it would not be necessary, but maybe we feel differently about that now? In any case, here are the semantics of this flag: - `-Zmin-function-alignment=<align>` specifies the minimum alignment of all* functions - the `#[repr(align(<align>))]` attribute can be used to override the function alignment on a per-function basis: when `-Zmin-function-alignment` is specified, the attribute's value is only used when it is higher than the value passed to `-Zmin-function-alignment`. - the target may decide to use a higher value (e.g. on x86_64 the minimum that LLVM generates is 16) - The highest supported alignment in rust is `2^29`: I checked a bunch of targets, and they all emit the `.p2align 29` directive for targets that align functions at all (some GPU stuff does not have function alignment). *: Only with `build-std` would the minimum alignment also be applied to `std` functions. --- cc `@ojeda` r? `@workingjubilee` you were active on the tracking issue
2025-01-11ci: Organise shared helper scriptsKajetan Puchalski-200/+41
Move shared helper scripts used by Docker builds under docker/scripts.
2025-01-11collect diag suggestions instead of pushing into vector repeatedlyYotam Ofek-12/+9
2025-01-11improve clunky grammar in borrowck diagnosticYotam Ofek-3/+3
2025-01-11fix `it's` -> `its` in doc commentYotam Ofek-1/+1
2025-01-11Auto merge of #135292 - lqd:rustcperfup, r=kobzolbors-0/+0
bump `rustc-perf` submodule This updates the `rustc-perf` submodule to pull in the recent changes, in particular the error handling in https://github.com/rust-lang/rustc-perf/pull/2021 fixing the error we saw in a recent run. I think I did this correctly, submodules are so annoying. r? kobzol (opening as draft to do a perf run and check that nothing has changed indeed)
2025-01-11migrate `clippy` to the `DenseBitSet` nameRémy Rakic-18/+18
2025-01-11migrate `rustc_codegen_gcc` to the `DenseBitSet` nameRémy Rakic-5/+5
2025-01-11document the use-cases of `DenseBitSet` a bit moreRémy Rakic-1/+7
2025-01-11rename `BitSet` to `DenseBitSet`Rémy Rakic-356/+367
This should make it clearer that this bitset is dense, with the advantages and disadvantages that it entails.
2025-01-11update and clarify StructuralPartialEq docsRalf Jung-18/+13
2025-01-11Auto merge of #135357 - jhpratt:rollup-gs00yt3, r=jhprattbors-250/+748
Rollup of 6 pull requests Successful merges: - #134074 (bootstrap: `std::io::ErrorKind::CrossesDevices` is finally stable) - #135236 (Update a bunch of library types for MCP807) - #135301 (re-add a warning for old master branch, but with much simpler logic) - #135324 (Initial fs module for uefi) - #135326 (support target specific `optimized-compiler-builtins`) - #135347 (Use `NonNull::without_provenance` within the standard library) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-11Rollup merge of #135347 - samueltardieu:push-qvyxtxsqyxyr, r=jhprattJacob Pratt-29/+13
Use `NonNull::without_provenance` within the standard library This API removes the need for several `unsafe` blocks, and leads to clearer code. It uses feature `nonnull_provenance` (#135243). Close #135343
2025-01-11Rollup merge of #135326 - onur-ozkan:target-specific-compiler-builtins, ↵Jacob Pratt-2/+36
r=jieyouxu support target specific `optimized-compiler-builtins` Makes it possible to control `optimized-compiler-builtins` for per target. This was raised in the [zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Building.20and.20packaging.20Rust.20with.20x86_64-unknown-uefi.20support/near/492765883) yesterday.
2025-01-11Rollup merge of #135324 - Ayush1325:uefi-fs-unsupported, r=joboetJacob Pratt-1/+344
Initial fs module for uefi - Just a copy of unsupported fs right now to reduce the noise from future PRs to allow for easier review. - For the full working version of fs on uefi, see [0] - This is an effort to break the original PR (#129700) into much smaller chunks for faster upstreaming. [0]: https://github.com/Ayush1325/rust/tree/uefi-file-full
2025-01-11Rollup merge of #135301 - lolbinarycat:bootstrap-old-master-resurected, ↵Jacob Pratt-0/+3
r=onur-ozkan re-add a warning for old master branch, but with much simpler logic instead of calling into git or checking the modification time of files, simply print the warning if there is a very large number of "modified" files. also make the wording much softer, so false positives are less alarming. (warning was removed in https://github.com/rust-lang/rust/issues/134935)