Skip to content

Commit

Permalink
gccrs: add test case to show impl block on ! works
Browse files Browse the repository at this point in the history
The resolution with ! was fixed in: 09cfe53 this adds a
test case to show the other issue is also fixed.

Fixes #2951

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: nr2 is crashing here
	* rust/compile/issue-2951.rs: New test.

Signed-off-by: Philip Herron <[email protected]>
  • Loading branch information
philberty committed Sep 26, 2024
1 parent 09cfe53 commit e4866ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gcc/testsuite/rust/compile/issue-2951.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#[lang = "sized"]
pub trait Sized {}

#[lang = "clone"]
pub trait Clone: Sized {
fn clone(&self) -> Self;
}

impl Clone for ! {
fn clone(&self) -> Self {
*self
}
}
1 change: 1 addition & 0 deletions gcc/testsuite/rust/compile/nr2/exclude
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,4 @@ dropck_eyepatch_feature_gate.rs
inline_asm_parse_output_operand.rs
issue-3030.rs
issue-3035.rs
issue-2951.rs

0 comments on commit e4866ff

Please sign in to comment.