Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
22
tests/ui/impl-trait/in-trait/object-safety.rs
Normal file
22
tests/ui/impl-trait/in-trait/object-safety.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
#![feature(return_position_impl_trait_in_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
trait Foo {
|
||||
fn baz(&self) -> impl Debug;
|
||||
}
|
||||
|
||||
impl Foo for u32 {
|
||||
fn baz(&self) -> u32 {
|
||||
32
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let i = Box::new(42_u32) as Box<dyn Foo>;
|
||||
//~^ ERROR the trait `Foo` cannot be made into an object
|
||||
//~| ERROR the trait `Foo` cannot be made into an object
|
||||
let s = i.baz();
|
||||
//~^ ERROR the trait `Foo` cannot be made into an object
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue