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
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/issues/issue-27033.rs

13 lines
283 B
Rust
Raw Normal View History

prohibit the lhs of an @-pattern being a constant as this breaks code that worked under some conditions, this is a [breaking-change] Fixes #27033 Fixes #27077
2015-07-28 16:52:54 +03:00
fn main() {
match Some(1) {
Move pattern resolution checks from typeck to resolve Make error messages more precise
2016-09-15 00:51:46 +03:00
None @ _ => {} //~ ERROR match bindings cannot shadow unit variants
prohibit the lhs of an @-pattern being a constant as this breaks code that worked under some conditions, this is a [breaking-change] Fixes #27033 Fixes #27077
2015-07-28 16:52:54 +03:00
};
const C: u8 = 1;
match 1 {
resolve: Rewrite resolve_pattern
2016-06-03 23:15:00 +03:00
C @ 2 => { //~ ERROR match bindings cannot shadow constant
prohibit the lhs of an @-pattern being a constant as this breaks code that worked under some conditions, this is a [breaking-change] Fixes #27033 Fixes #27077
2015-07-28 16:52:54 +03:00
println!("{}", C);
}
_ => {}
};
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 5010ms Template: 5ms
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