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: fix ICE during name resolution for impls on unit-types
The canonical paths need to support unit-types which are technically a TupleType with no fields. This handles this case and adds an unreachable. Fixes Rust-GCC#3036 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveTypeToCanonicalPath::visit): add unit-type catch * resolve/rust-ast-resolve-type.h: likewise gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3036.rs: New test. Signed-off-by: Philip Herron <[email protected]>
- Loading branch information
Showing
4 changed files
with
26 additions
and
0 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
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 @@ | ||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
#[stable(feature = "rust1", since = "1.0.0")] | ||
pub trait Default: Sized { | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
fn default() -> Self; | ||
} | ||
|
||
impl Default for () { | ||
fn default() -> () { | ||
() | ||
} | ||
} |
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 |
---|---|---|
|
@@ -252,3 +252,4 @@ issue-3082.rs | |
issue-3139-1.rs | ||
issue-3139-2.rs | ||
issue-3139-3.rs | ||
issue-3036.rs |