Skip to content

Commit

Permalink
Add regression test for rust-lang#104631
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Okushi <[email protected]>
  • Loading branch information
JohnTitor committed Apr 11, 2023
1 parent 87a2408 commit a1db1a2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ui/dyn-star/issue-104631.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![feature(dyn_star)]
#![allow(incomplete_features)]

use std::fmt::Debug;

#[repr(C)]
#[derive(Debug)]
struct AlignedUsize(usize);

fn main() {
let _x = AlignedUsize(12) as dyn* Debug; //~ ERROR: `AlignedUsize` needs to have the same ABI as a pointer
}
11 changes: 11 additions & 0 deletions tests/ui/dyn-star/issue-104631.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0277]: `AlignedUsize` needs to have the same ABI as a pointer
--> $DIR/issue-104631.rs:11:14
|
LL | let _x = AlignedUsize(12) as dyn* Debug;
| ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-like type
|
= help: the trait `PointerLike` is not implemented for `AlignedUsize`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.

0 comments on commit a1db1a2

Please sign in to comment.