]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.rs
Auto merge of #86155 - alexcrichton:abort-on-unwind, r=nikomatsakis
[rust.git] / src / test / ui / const-generics / const_evaluatable_checked / object-safety-err-where-bounds.rs
1 #![feature(const_generics, const_evaluatable_checked)]
2 #![allow(incomplete_features)]
3 #![deny(where_clauses_object_safety)]
4
5
6 const fn bar<T: ?Sized>() -> usize { 7 }
7
8 trait Foo {
9     fn test(&self) where [u8; bar::<Self>()]: Sized;
10     //~^ ERROR the trait `Foo` cannot be made into an object
11     //~| WARN this was previously accepted by the compiler but is being phased out
12 }
13
14 impl Foo for () {
15     fn test(&self) where [u8; bar::<Self>()]: Sized {}
16 }
17
18 fn use_dyn(v: &dyn Foo) {
19     v.test();
20 }
21
22 fn main() {}