Skip to content

Commit cb3b42c

Browse files
committedJan 15, 2021
Add issue-80742
rust-lang/rust#80742
1 parent 04220b0 commit cb3b42c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
 

‎ices/80742.rs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#![feature(const_evaluatable_checked)]
2+
#![feature(const_generics)]
3+
#![allow(incomplete_features)]
4+
5+
use core::fmt::Debug;
6+
use core::marker::PhantomData;
7+
8+
struct Inline<T>
9+
where
10+
[u8; ::core::mem::size_of::<T>() + 1]: ,
11+
{
12+
_phantom: PhantomData<T>,
13+
buf: [u8; ::core::mem::size_of::<T>() + 1],
14+
}
15+
16+
impl<T> Inline<T>
17+
where
18+
[u8; ::core::mem::size_of::<T>() + 1]: ,
19+
{
20+
pub fn new(val: T) -> Inline<T> {
21+
todo!()
22+
}
23+
}
24+
25+
fn main() {
26+
// let dst = Inline::<usize>::new(0); OK
27+
let dst = Inline::<dyn Debug>::new(0); // BANG!
28+
}

0 commit comments

Comments
 (0)
Please sign in to comment.