-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempted to access a nonexistent field [E0609]
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add error code and update error message gcc/testsuite/ChangeLog: * rust/compile/nonexistent-field.rs: New test. Signed-off-by: Muhammad Mahad <[email protected]>
- Loading branch information
1 parent
e61d37a
commit 0f2062b
Showing
2 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![allow(unused)] | ||
fn main() { | ||
struct StructWithFields { | ||
x: u32, | ||
} | ||
|
||
let s = StructWithFields { x: 0 }; | ||
s.foo; | ||
// { dg-error "no field .foo. on type .StructWithFields.StructWithFields .x.u32... .E0609." "" { target *-*-* } .-1 } | ||
|
||
let numbers = (1, 2, 3); | ||
numbers.3; | ||
// { dg-error "no field .3. on type ..<integer>, <integer>, <integer>.. .E0609." "" { target *-*-* } .-1 } | ||
} |