Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
b3827e4f3728b77bd3e60587487ebfc3cc8d901b
rust/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs

10 lines
210 B
Rust
Raw Normal View History

[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ run-fail
//@ error-pattern:thread 'main' panicked
//@ error-pattern:attempt to multiply with overflow
tests: use `needs-subprocess` instead of `ignore-{wasm32,emscripten,sgx}`
2025-01-23 16:36:54 +08:00
//@ needs-subprocess
[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ compile-flags: -C debug-assertions
Add test for overflowing pow This would catch regressions of issue #28012.
2015-09-13 22:19:36 -04:00
fn main() {
Fix overflow checking in unsigned pow() The pow() method for unsigned integers produced 0 instead of trapping overflow for certain inputs. Calls such as 2u32.pow(1024) produced 0 when they should trap an overflow. This also adds tests for the correctly handling overflow in unsigned pow(). For issue number #34913
2016-07-20 18:23:52 -04:00
let _x = 2u32.pow(1024);
Add test for overflowing pow This would catch regressions of issue #28012.
2015-09-13 22:19:36 -04:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2581ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API