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-17800.rs

13 lines
239 B
Rust
Raw Normal View History

Fix handling of struct variants in a couple of places Fixes #17405. Fixes #17518. Fixes #17800.
2014-09-20 21:25:25 +02:00
enum MyOption<T> {
MySome(T),
MyNone,
}
fn main() {
Kill more `isize`s
2015-01-31 17:23:42 +01:00
match MyOption::MySome(42) {
MyOption::MySome { x: 42 } => (),
Tweak conditions for E0026 and E0769 When we have a tuple struct used with struct we don't want to suggest using the (valid) struct syntax with numeric field names. Instead we want to suggest the expected syntax. Given ```rust fn main() { match MyOption::MySome(42) { MyOption::MySome { x: 42 } => (), _ => (), } } ``` We now emit E0769 "tuple variant `MyOption::MySome` written as struct variant" instead of E0026 "variant `MyOption::MySome` does not have a field named `x`".
2020-08-09 16:56:47 -07:00
//~^ ERROR tuple variant `MyOption::MySome` written as struct variant
Fix handling of struct variants in a couple of places Fixes #17405. Fixes #17518. Fixes #17800.
2014-09-20 21:25:25 +02:00
_ => (),
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 7020ms Template: 3ms
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