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 Rust-GCC#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 27, 2024
1 parent 18422c9 commit b60ec4f
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 @@ -253,3 +253,4 @@ issue-3139-1.rs
issue-3139-2.rs
issue-3139-3.rs
issue-3036.rs
issue-2951.rs

0 comments on commit b60ec4f

Please sign in to comment.