Add autoderef tests for by-value trait objects.
This commit is contained in:
parent
b3dce87a86
commit
4fd895a6b8
2 changed files with 8 additions and 0 deletions
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue