-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
mir_build: Use the same length type for TestableCase::Slice and TestKind::Len
#150184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If we convert the minimum length to `u64` up-front when creating `TestableCase::Slice`, we can avoid more conversions to `u64` later.
|
Some changes occurred in match lowering cc @Nadrieril |
|
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 |
|
For some reason the actual bors queue page doesn’t show this PR in the queue. @bors r- |
|
@bors r=saethlin |
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. |
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.
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
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.
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
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.
…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
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.
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
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
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.
If we convert the minimum length to
u64up-front when creatingTestableCase::Slice, we can avoid more conversions tou64later.There should be no change to compiler behaviour.