AST/HIR: Merge field access expressions for named and numeric fields

This commit is contained in:
Vadim Petrochenkov 2018-04-01 21:48:39 +03:00
parent 6c537493d0
commit 44acea4d88
43 changed files with 105 additions and 432 deletions

View file

@ -7,10 +7,10 @@ LL | let _ = x.foo; //~ ERROR E0609
= note: available fields are: `x`
error[E0609]: no field `1` on type `Bar`
--> $DIR/E0609.rs:21:5
--> $DIR/E0609.rs:21:7
|
LL | y.1; //~ ERROR E0609
| ^^^
| ^ unknown field
error: aborting due to 2 previous errors

View file

@ -1,9 +0,0 @@
error[E0611]: field `0` of tuple-struct `a::Foo` is private
--> $DIR/E0611.rs:21:4
|
LL | y.0; //~ ERROR E0611
| ^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0611`.

View file

@ -1,9 +0,0 @@
error[E0612]: attempted out-of-bounds tuple index `1` on type `Foo`
--> $DIR/E0612.rs:15:4
|
LL | y.1; //~ ERROR E0612
| ^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0612`.

View file

@ -18,5 +18,5 @@ mod a {
fn main() {
let y = a::Foo::new();
y.0; //~ ERROR E0611
y.0; //~ ERROR field `0` of struct `a::Foo` is private
}

View file

@ -0,0 +1,9 @@
error[E0616]: field `0` of struct `a::Foo` is private
--> $DIR/ex-E0611.rs:21:4
|
LL | y.0; //~ ERROR field `0` of struct `a::Foo` is private
| ^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0616`.

View file

@ -12,5 +12,5 @@ struct Foo(u32);
fn main() {
let y = Foo(0);
y.1; //~ ERROR E0612
y.1; //~ ERROR no field `1` on type `Foo`
}

View file

@ -0,0 +1,9 @@
error[E0609]: no field `1` on type `Foo`
--> $DIR/ex-E0612.rs:15:6
|
LL | y.1; //~ ERROR no field `1` on type `Foo`
| ^ did you mean `0`?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0609`.