Repository navigation
Rollup of 8 pull requests - #164430
Rollup of 8 pull requests#164430
Conversation
…overflow Self-referential RTN expands args on each unrolling step, bypassing the `self.types.insert` cycle check. Track depth against `recursion_limit` and short-circuit with `ControlFlow::Break` when exceeded so we don't blow the stack.
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
Install LLVM 23 from apt.llvm.org.
…s, r=adwinwhite handle trait solver overflow in `codegen_select_candidate` We now report overflow errors in `codegen_select_candidate` instead of failing to resolve instance and ICE. fixes rust-lang#162343 fixes rust-lang/trait-system-refactor-initiative#306
Fix: Construct byte string valtree array type using literal length closes rust-lang#163904 ## Bug Mentioned in the issue. The reason type checking was not catching the `SizeOverflow` before `const` evaluation starts was: The trait solver just checks that the constant's own type equals the declared type https://github.com/rust-lang/rust/blob/472684ea0c352dad27153b2a9646b0fcd7c8daf8/compiler/rustc_trait_selection/src/traits/fulfill.rs?plain=1#L582-L595 Hence building the value lead to `Err` value from `layout_of` leading panic in `valtree_to_ref`. https://github.com/rust-lang/rust/blob/472684ea0c352dad27153b2a9646b0fcd7c8daf8/compiler/rustc_const_eval/src/const_eval/valtrees.rs?plain=1#L395 ## Solution As suggested by @BoxyUwU and @oli-obk We shouldn't blindly copy the declared type and size! Rather label the value with its real size. Hence now `[u8; 0] != [u8; usize::MAX]`, so the compiler reports normal error. # How to test Run `./x test tests/ui/const-generics/mgca --stage 1` **Manual test** mentioned in the issue
…=oli-obk refine: respect recursion limit in RPITIT collector to prevent stack overflow Fixes rust-lang#163866. Prevents a compiler stack overflow (SIGSEGV) during `refining_impl_trait` checks when an RPITIT return type references its own RTN projection: trait IntFactory { fn stream(&self) -> impl IntFactory<stream(..): Send>; } impl IntFactory for S { fn stream(&self) -> impl IntFactory<stream(..): Send> { todo!() } } ### Cause `ImplTraitInTraitCollector` was detecting cycles using `self.types.insert(proj)`. Because `proj` is an alias projection type that includes generic substitutions, self-referential RTN expands deeper generic arguments on each unrolling step: - `stream::{opaque#0}<S>` - `stream::{opaque#0}<<S as IntFactory>::stream::{opaque#0}>>` - `stream::{opaque#0}<<<S as IntFactory>::stream::{opaque#0} as IntFactory>::stream::{opaque#0}>>>` Since generic args change on every step, `proj` never compares equal to any previously visited item, causing the visitor to loop infinitely until stack exhaustion. ### Fix Instead of outright banning seen `DefId`s (which would cut off valid finitely unrolling types), track the unrolling depth against `tcx.recursion_limit()`. When depth hits the recursion limit, the visitor now short-circuits immediately via `ControlFlow::Break(())` and `?`. This avoids exploring an exponential branching tree when multiple self-referential bounds exist, cleanly terminating the refine check. Added UI regression test in `tests/ui/impl-trait/in-trait/refine-self-referential-rtn.rs`.
…cope-of-object, r=GuillaumeGomez Make the `documentation` scope a sub-scope of the `object` scope ~~First commit from rust-lang#164278.~~ This PR moves the `documentation` scope to be a sub-scope of the `object` scope. The `object` scope is currently defined to be: "This ensures all paths in compiled executables, libraries and objects outputs are remapped but not elsewhere", which can be translated to mean everything written to disk by `rustc` it-self. It is therefore a natural extension for the `documentation` scope to be a sub-scope of it, like `macro`, `debuginfo` and `coverage`, since we use it for things written down on disk, like rustdoc-json (with rust-lang#164278 at-least) or the source code viewer.
Update LoongArch64 Linux dist builder to LLVM 23 This is also a defensive fix, as certain linker inputs can trigger an ["address assignment did not converge"](llvm/llvm-project#226712) error during linker relaxation in LLD versions prior to 23.1.3, causing the link to fail.
…smutability, r=ShoyuVanilla Avoid erased region on transmutability It seems like the erasure of regions here wasn't needed anymore since all tests pass and removing it makes the next-solver looses it's lifetime extensions powers. Fixed the last test in rust-lang/trait-system-refactor-initiative#152 Closes rust-lang#164246 [discussed in zulip](https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/next.20solver.20and.20the.20philosopher.20stone/with/631772202) r? @lcnr
…v-libc, r=jieyouxu cargotest: update xsv libc for RISC-V Fixes rust-lang#164339. The xsv repository pinned by `cargotest` has a lockfile from 2018 that uses `libc 0.2.43`. That version fails to compile on RISC-V because it does not define `c_char` for the target. Add a `cargotest` lockfile for xsv with only `libc` updated to `0.2.190` and use the existing lockfile override mechanism. This keeps xsv and its other dependencies at their current pinned versions. Tests: - `cargo update -p libc --precise 0.2.190` in the pinned xsv checkout - `cargo check --target riscv64gc-unknown-linux-gnu --tests` in xsv - `cargotest <cargo> <out-dir> xsv` (394 selected tests passed on x86_64) The full test suite has not been run on RISC-V hardware.
…rame-init-hook, r=RalfJung Implement after-stack-frame-init-hook Adds a new hook to `compiler/rustc_const_eval/src/interpret/machine.rs` that gets called immediately after a stack frame's function arguments are fully initialized. r?<@RalfJung>
This comment has been minimized.
This comment has been minimized.
Rollup of 8 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu try-job: test-x86_64-gnu-llvm-22-3
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing bf9448e (parent) -> 5d8fec0 (this PR) Test differencesShow 46 test diffsStage 1
Stage 2
Additionally, 3 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 5d8fec0669a64607db9ccbf663e7c23125bf4748 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (5d8fec0): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 488.875s -> 490.438s (0.32%) |
|
📌 Perf builds for each rolled up PR:
parent commit: bf9448e426 In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: |
Successful merges:
codegen_select_candidate#162467 (handle trait solver overflow incodegen_select_candidate)documentationscope a sub-scope of theobjectscope #164279 (Make thedocumentationscope a sub-scope of theobjectscope)r? @ghost
Create a similar rollup