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
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/consts/const-eval/issue-43197.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
187 B
Rust
Raw Normal View History

trans::mir::constant - fix assignment error recovery We used to not store anything when the RHS of an assignment returned an error, which caused ICEs downstream. Fixes #43197.
2017-07-31 17:42:42 +03:00
const fn foo(x: u32) -> u32 {
x
}
fn main() {
Errors in promoteds may only cause lints not hard errors
2020-01-08 21:31:08 +01:00
const X: u32 = 0 - 1;
Use the informative error as the main const eval error message
2025-05-28 10:29:08 +00:00
//~^ ERROR overflow
Errors in promoteds may only cause lints not hard errors
2020-01-08 21:31:08 +01:00
const Y: u32 = foo(0 - 1);
Use the informative error as the main const eval error message
2025-05-28 10:29:08 +00:00
//~^ ERROR overflow
trans::mir::constant - fix assignment error recovery We used to not store anything when the RHS of an assignment returned an error, which caused ICEs downstream. Fixes #43197.
2017-07-31 17:42:42 +03:00
println!("{} {}", X, Y);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2251ms 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