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.
gccrs: fix ICE when we have unimplemented/invalid trait items
When the resulting trait item is in an error state this means the underlying fields will be null. Fixes Rust-GCC#2478 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-item.cc: add is_error check gcc/testsuite/ChangeLog: * rust/compile/non_member_const.rs: add missing error message * rust/compile/issue-2478.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
- Loading branch information
1 parent
c53e0af
commit 1e49e88
Showing
3 changed files
with
20 additions
and
5 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,16 @@ | ||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
struct Bar; | ||
|
||
trait Foo { | ||
const N: u32; | ||
|
||
fn M(); | ||
} | ||
|
||
impl Foo for Bar { | ||
// { dg-error "missing N, M in implementation of trait .Foo." "" { target *-*-* } .-1 } | ||
fn N() {} | ||
// { dg-error "method .N. is not a member of trait .Foo." "" { target *-*-* } .-1 } | ||
} |
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