about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-18 14:21:48 +0000
committerbors <bors@rust-lang.org>2023-09-18 14:21:48 +0000
commit4022591cfd7890e3db8e477986d47a336cd230a7 (patch)
treece360c8be4761716ccf9956e78fe914a06d6e276 /tests
parentea16f812beb8e1c709d450fcc0d2c4bb8e6f50dc (diff)
parent3665a4102bce2cd6b09a7aea1b405cc640e076d8 (diff)
downloadrust-4022591cfd7890e3db8e477986d47a336cd230a7.tar.gz
rust-4022591cfd7890e3db8e477986d47a336cd230a7.zip
Auto merge of #11517 - mojave2:issue-11426, r=Alexendoo
fix ICE by `u64::try_from(<u128>)`

changelog: Fix the ICE in [`cast_possible_truncation`], when the `Shr` bits is larger than `u64::MAX`

fix #11426
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/cast.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/ui/cast.rs b/tests/ui/cast.rs
index d0a092093f3..1ca18170f8a 100644
--- a/tests/ui/cast.rs
+++ b/tests/ui/cast.rs
@@ -361,3 +361,7 @@ fn avoid_subtract_overflow(q: u32) {
     //~^ ERROR: casting `u32` to `u8` may truncate the value
     c as usize;
 }
+
+fn issue11426() {
+    (&42u8 >> 0xa9008fb6c9d81e42_0e25730562a601c8_u128) as usize;
+}