Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/const_prop/const-prop-overflowing-casts.rs

16 lines
246 B
Rust
Raw Normal View History

[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ check-pass
Revert `const_err` lint checking of casts Reverts part of #67676
2020-01-02 20:28:21 -05:00
enum Foo {
Bar = -42,
Baz = 42,
}
Lint overflowing integer casts in const prop This extends the invalid cases we catch in const prop to include overflowing integer casts using the same machinery as the overflowing binary and unary operation logic.
2019-12-12 22:03:32 -05:00
fn main() {
let _ = 0u8 as u32;
Revert `const_err` lint checking of casts Reverts part of #67676
2020-01-02 20:28:21 -05:00
let _ = (1u32 << 31) as u16;
let _ = (1u16 << 15) as u8;
let _ = (!0u16) as u8;
let _ = (-1i16) as i8;
let _ = (Foo::Bar) as i8;
Lint overflowing integer casts in const prop This extends the invalid cases we catch in const prop to include overflowing integer casts using the same machinery as the overflowing binary and unary operation logic.
2019-12-12 22:03:32 -05:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1284ms 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