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
cf2dff2b1e3fa55fa5415d524200070d0d7aacfe
rust/tests/ui/tuple/tuple-index-not-tuple.rs

11 lines
219 B
Rust
Raw Normal View History

Update compile fail tests to use isize.
2015-01-08 21:54:35 +11:00
struct Point { x: isize, y: isize }
Implement tuple and tuple struct indexing This allows code to access the fields of tuples and tuple structs: let x = (1i, 2i); assert_eq!(x.1, 2); struct Point(int, int); let origin = Point(0, 0); assert_eq!(origin.0, 0); assert_eq!(origin.1, 0);
2014-08-10 15:54:33 +12:00
struct Empty;
fn main() {
let origin = Point { x: 0, y: 0 };
origin.0;
Fold E0613 into E0609 Resolves #42945
2017-06-30 20:36:51 +02:00
//~^ ERROR no field `0` on type `Point`
Implement tuple and tuple struct indexing This allows code to access the fields of tuples and tuple structs: let x = (1i, 2i); assert_eq!(x.1, 2); struct Point(int, int); let origin = Point(0, 0); assert_eq!(origin.0, 0); assert_eq!(origin.1, 0);
2014-08-10 15:54:33 +12:00
Empty.0;
Fold E0613 into E0609 Resolves #42945
2017-06-30 20:36:51 +02:00
//~^ ERROR no field `0` on type `Empty`
Implement tuple and tuple struct indexing This allows code to access the fields of tuples and tuple structs: let x = (1i, 2i); assert_eq!(x.1, 2); struct Point(int, int); let origin = Point(0, 0); assert_eq!(origin.0, 0); assert_eq!(origin.1, 0);
2014-08-10 15:54:33 +12:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3694ms 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