Skip to content

Conversation

@Zalathar
Copy link
Member

If we convert the minimum length to u64 up-front when creating TestableCase::Slice, we can avoid more conversions to u64 later.

There should be no change to compiler behaviour.

If we convert the minimum length to `u64` up-front when creating
`TestableCase::Slice`, we can avoid more conversions to `u64` later.
@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

Some changes occurred in match lowering

cc @Nadrieril

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

r? @saethlin

rustbot has assigned @saethlin.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@saethlin
Copy link
Member

Oh jeez. I wonder if this would have caused chaos with large slices when cross compiling from a 32-bit host to a 64-bit target.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 20, 2025

📌 Commit 19f74f4 has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 20, 2025
@Zalathar
Copy link
Member Author

For some reason the actual bors queue page doesn’t show this PR in the queue.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 20, 2025
@Zalathar
Copy link
Member Author

@bors r=saethlin

@bors
Copy link
Collaborator

bors commented Dec 20, 2025

📌 Commit 19f74f4 has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 20, 2025
@Zalathar
Copy link
Member Author

Oh jeez. I wonder if this would have caused chaos with large slices when cross compiling from a 32-bit host to a 64-bit target.

In order to overflow a 32-bit host usize in this context, the crate being compiled would need to contain a slice pattern with 2^32 subpatterns. I suspect that's already impossible for other reasons, even for 64-bit hosts.

Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 21, 2025
mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`

If we convert the minimum length to `u64` up-front when creating `TestableCase::Slice`, we can avoid more conversions to `u64` later.

There should be no change to compiler behaviour.
bors added a commit that referenced this pull request Dec 21, 2025
Rollup of 13 pull requests

Successful merges:

 - #146377 (Don't strip shebang in expr-ctxt `include!(…)`)
 - #149437 (Fix trailing newline in JUnit formatter)
 - #149658 (tests/assembly-llvm/some-non-zero-from-atomic-optimization.rs: New test)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #149882 (miri: add -Zbinary-dep-depinfo to dependency builds)
 - #150009 (Enable llvm-libunwind by default for Hexagon targets)
 - #150035 (fix docustring on fetch_or)
 - #150082 (tests/ui/traits/fmt-pointer-trait.rs: Add HRTB fn pointer case)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150184 (mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)
 - #150208 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 21, 2025
mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`

If we convert the minimum length to `u64` up-front when creating `TestableCase::Slice`, we can avoid more conversions to `u64` later.

There should be no change to compiler behaviour.
bors added a commit that referenced this pull request Dec 21, 2025
Rollup of 11 pull requests

Successful merges:

 - #146377 (Don't strip shebang in expr-ctxt `include!(…)`)
 - #149658 (tests/assembly-llvm/some-non-zero-from-atomic-optimization.rs: New test)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #149882 (miri: add -Zbinary-dep-depinfo to dependency builds)
 - #150009 (Enable llvm-libunwind by default for Hexagon targets)
 - #150035 (fix docustring on fetch_or)
 - #150082 (tests/ui/traits/fmt-pointer-trait.rs: Add HRTB fn pointer case)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150184 (mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)

r? `@ghost`
`@rustbot` modify labels: rollup
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Dec 21, 2025
mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`

If we convert the minimum length to `u64` up-front when creating `TestableCase::Slice`, we can avoid more conversions to `u64` later.

There should be no change to compiler behaviour.
bors added a commit that referenced this pull request Dec 21, 2025
…uwer

Rollup of 13 pull requests

Successful merges:

 - #146377 (Don't strip shebang in expr-ctxt `include!(…)`)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #149882 (miri: add -Zbinary-dep-depinfo to dependency builds)
 - #150009 (Enable llvm-libunwind by default for Hexagon targets)
 - #150035 (fix docustring on fetch_or)
 - #150082 (tests/ui/traits/fmt-pointer-trait.rs: Add HRTB fn pointer case)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150184 (mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`)
 - #150185 ([rustdoc] Add missing close tags in extern crate reexports)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)
 - #150208 (Update books)
 - #150210 (tests/debuginfo/function-arg-initialization.rs: Stop disabling SingleUseConsts MIR pass)

r? `@ghost`
`@rustbot` modify labels: rollup
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Dec 21, 2025
mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`

If we convert the minimum length to `u64` up-front when creating `TestableCase::Slice`, we can avoid more conversions to `u64` later.

There should be no change to compiler behaviour.
bors added a commit that referenced this pull request Dec 21, 2025
Rollup of 11 pull requests

Successful merges:

 - #146377 (Don't strip shebang in expr-ctxt `include!(…)`)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #149882 (miri: add -Zbinary-dep-depinfo to dependency builds)
 - #150009 (Enable llvm-libunwind by default for Hexagon targets)
 - #150035 (fix docustring on fetch_or)
 - #150082 (tests/ui/traits/fmt-pointer-trait.rs: Add HRTB fn pointer case)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150184 (mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`)
 - #150185 ([rustdoc] Add missing close tags in extern crate reexports)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Dec 22, 2025
Rollup of 11 pull requests

Successful merges:

 - #146377 (Don't strip shebang in expr-ctxt `include!(…)`)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #149882 (miri: add -Zbinary-dep-depinfo to dependency builds)
 - #150009 (Enable llvm-libunwind by default for Hexagon targets)
 - #150035 (fix docustring on fetch_or)
 - #150082 (tests/ui/traits/fmt-pointer-trait.rs: Add HRTB fn pointer case)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150184 (mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`)
 - #150185 ([rustdoc] Add missing close tags in extern crate reexports)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e0b5d93 into rust-lang:main Dec 22, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 22, 2025
@Zalathar Zalathar deleted the slice-len branch December 22, 2025 06:58
rust-timer added a commit that referenced this pull request Dec 22, 2025
Rollup merge of #150184 - Zalathar:slice-len, r=saethlin

mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`

If we convert the minimum length to `u64` up-front when creating `TestableCase::Slice`, we can avoid more conversions to `u64` later.

There should be no change to compiler behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants