about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-12Rollup merge of #135401 - joshtriplett:empty-expected, r=lqdGuillaume Gomez-0/+0
Remove some empty expected files to fix blessing https://github.com/rust-lang/rust/pull/134808 made --bless remove empty expected files. Remove some empty files that were causing noise in unrelated `--bless` invocations.
2025-01-12Rollup merge of #135383 - BoxyUwU:cov_tag_ptr, r=compiler-errorsGuillaume Gomez-985/+291
De-abstract tagged ptr and make it covariant In #135272 I needed to use a tagged ptr in `hir::TyKind` in order to not regress hir type sizes. Unfortunately the existing `CopyTaggedPtr` abstraction is insufficient as it makes the `'hir` lifetime invariant. I spent some time trying to keep existing functionality while making it covariant but in the end I realised that actually we dont use *any* of this code *anywhere* in rustc, so I've just removed everything and replaced it with a much less general abstraction that is suitable for what I need in #135272. Idk if anyone has a preference for just keeping all the abstractions here in case anyone needs them in the future :woman_shrugging:
2025-01-12Rollup merge of #135365 - saethlin:box-new, r=compiler-errorsGuillaume Gomez-2/+2
Update the explanation for why we use box_new in vec! The perf run in this PR demonstrates that there is no longer a dramatic change in compile time with the intrinsic `box_new` vs calling `Box::new`, but I've locally confirmed that there is still a dramatic change in stack use.
2025-01-12Rollup merge of #135348 - aDotInTheVoid:pathspathspaths, r=GuillaumeGomezGuillaume Gomez-13/+151
rustdoc-json: Include items in stripped modules in `Crate::paths`. Closes #135309 When we're running rustdoc-json, we should err on the side of adding more items to `Cache::paths`, as that directly becomes `Crate::paths` in the output. r? ``@GuillaumeGomez.`` Best reviewed commit-by-commit.
2025-01-12Update the explanation for why we use box_new in vec!Ben Kimock-2/+2
2025-01-12Auto merge of #135281 - onur-ozkan:build-stamps, r=jieyouxubors-362/+434
centralize build stamp logic This PR brings all the stamp file handling into one place inside `build_stamp` module, which takes care of everything related to build stamps. By doing this, we cut down on duplicated code and types and keep the codebase easier to maintain and more consistent. Main goals are: - Make stamp handling stricter so we don't have to pass `Path`s around and manually `join` on arbitrary directories - Keep all stamp-related logic in one place - Make it easier to test and debug - Avoid duplication - Keep things simple and well-documented Resolves #134962
2025-01-12De-abstract tagged pointer abstractionBoxy-985/+291
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-12Remove some empty expected files to fix blessingJosh Triplett-0/+0
https://github.com/rust-lang/rust/pull/134808 made --bless remove empty expected files. Remove some empty files that were causing noise in unrelated `--bless` invocations.
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-12update doc-comment of `BuildStamp::add_stamp`onur-ozkan-1/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
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-12rename `done_stamp` to `lld_stamp`onur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12rustc-dev-guide: update outdated LLVM stamp filenameonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12add change entry for renamingsonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12avoid magical `AsRef<Path>` implementationonur-ozkan-29/+37
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12refactor `with_stamp` as `add_stamp` for incrementalityonur-ozkan-14/+13
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12extend sanitizers stamp calculationonur-ozkan-7/+13
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12run git only inside the current directoryonur-ozkan-0/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12migrate lld build stamponur-ozkan-5/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12apply minor improvements on build_stamponur-ozkan-1/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12auto label `A-bootstrap-stamp`onur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12migrate `program_out_of_date` to `BuildStamp::is_up_to_date`onur-ozkan-46/+20
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12add coverage for `BuildStamp::with_prefix`onur-ozkan-0/+16
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12fix an invalid prefix usage on enzymeonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12fix compiler errorsonur-ozkan-2/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12migrate `generate_smart_stamp_hash`onur-ozkan-55/+55
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12add test coverage for `build_stamp` implementationonur-ozkan-0/+47
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12document `build_stamp` implementationonur-ozkan-6/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12migrate `Builder::clear_if_dirty`onur-ozkan-30/+29
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12migrate helper stamp functionsonur-ozkan-141/+79
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12migrate `HashStamp` to `BuildStamp`onur-ozkan-66/+29
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12use `BuildStamp` instead of std paths and stringsonur-ozkan-69/+86
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12implement `BuildStamp` that is stricter impl for build stampsonur-ozkan-2/+78
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-12run-make-support: don't use lossy on `TARGET_RPATH_DIR`许杰友 Jieyou Xu (Joe)-2/+1