1
Fork 0

Add autoderef tests for by-value trait objects.

This commit is contained in:
Masaki Hara 2018-10-24 23:18:15 +09:00
parent b3dce87a86
commit 4fd895a6b8
2 changed files with 8 additions and 0 deletions

View file

@ -24,4 +24,8 @@ impl Foo for A {}
fn main() {
let x = *(Box::new(A) as Box<dyn Foo>);
assert_eq!(x.foo(), format!("hello"));
// I'm not sure whether we want this to work
let x = Box::new(A) as Box<dyn Foo>;
assert_eq!(x.foo(), format!("hello"));
}

View file

@ -26,4 +26,8 @@ impl Foo for A {
fn main() {
let x = *(Box::new(A) as Box<dyn Foo>);
assert_eq!(x.foo(), format!("hello"));
// I'm not sure whether we want this to work
let x = Box::new(A) as Box<dyn Foo>;
assert_eq!(x.foo(), format!("hello"));
}