You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![allow(unused)]fnmain(){structStructWithFields{x:u32,}let s = StructWithFields{x:0};
s.foo;// error: no field `foo` on type `StructWithFields`let numbers = (1,2,3);
numbers.3;}
Does the code make use of any (1.49) nightly feature ?
The current behavior is, gccrs doesn't emit E0609 error code
<source>:8:5: error: unknown field [foo]for type [StructWithFields{StructWithFields{x:u32}}]8 | s.foo;// error: no field `foo` on type `StructWithFields`
| ^
<source>:11:5:error:unknown field at index 311 | numbers.3;
| ^~~~~~~
Compiler returned:1
error[E0609]: no field `foo` on type `StructWithFields`
--> <source>:8:7
|
8 | s.foo;// error: no field `foo` on type `StructWithFields`
| ^^^ unknown field
|
= note: available field is: `x`
error[E0609]: no field `3` on type `({integer},{integer},{integer})`
--> <source>:11:13
|
11 | numbers.3;
| ^ unknown field
error:aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0609`.Compiler returned:1
Attempted to access a nonexistent field in a struct -
E0609
Reproducer
I tried modified code from https://github.com/rust-lang/rustlings/blob/main/exercises/04_primitive_types/primitive_types6.rs and https://doc.rust-lang.org/error_codes/E0609.html:
Does the code make use of any (1.49) nightly feature ?
Godbolt
Actual behavior
The current behavior is, gccrs doesn't emit
E0609
error codeExpected behavior
I expected to see gccrs emit
E0609
error codeGCC Version
be1e78b
Addresses #2553
The text was updated successfully, but these errors were encountered: