forked from Rust-GCC/gccrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rust-GCC#3046] ICE on failing to find enum variant
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc: Fix ICE caused by not finding enum variant by adding new error message gcc/testsuite/ChangeLog: * rust/compile/issue-3046.rs: Add test for new error message Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
- Loading branch information
1 parent
043ce27
commit bfee9e0
Showing
2 changed files
with
31 additions
and
1 deletion.
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,23 @@ | ||
enum Res { | ||
OK, | ||
BAD, | ||
} | ||
|
||
enum LOption { | ||
Some(i32), | ||
None, | ||
} | ||
|
||
fn test(v: LOption) -> Res { | ||
return Res::BAD; | ||
} | ||
|
||
|
||
fn main() { | ||
// Should be: | ||
// test(LOption::Some(2)); | ||
// | ||
test(LOption(2)); | ||
// { dg-error "expected function, tuple struct or tuple variant, found enum" "" { target *-*-* } .-1 } | ||
// { dg-error "failed to resolve type for argument expr in CallExpr" "" { target *-*-* } .-2 } | ||
} |