]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/generic_const_exprs/issue-80742.rs
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
[rust.git] / tests / ui / const-generics / generic_const_exprs / issue-80742.rs
1 // check-fail
2
3 // This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place
4
5 #![allow(incomplete_features)]
6 #![feature(generic_const_exprs)]
7
8 use std::fmt::Debug;
9 use std::marker::PhantomData;
10 use std::mem::size_of;
11
12 struct Inline<T>
13 where
14     [u8; size_of::<T>() + 1]: ,
15 {
16     _phantom: PhantomData<T>,
17     buf: [u8; size_of::<T>() + 1],
18 }
19
20 impl<T> Inline<T>
21 where
22     [u8; size_of::<T>() + 1]: ,
23 {
24     pub fn new(val: T) -> Inline<T> {
25         todo!()
26     }
27 }
28
29 fn main() {
30     let dst = Inline::<dyn Debug>::new(0); //~ ERROR
31     //~^ ERROR
32 }