]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized-locals/by-value-trait-object-safety-withdefault.rs
Don't resolve type var roots in point_at_expr_source_of_inferred_type
[rust.git] / tests / ui / unsized-locals / by-value-trait-object-safety-withdefault.rs
1 // run-pass
2
3 #![allow(incomplete_features)]
4 #![feature(unsized_locals, unsized_fn_params)]
5
6 pub trait Foo {
7     fn foo(self) -> String {
8         format!("hello")
9     }
10 }
11
12 struct A;
13
14 impl Foo for A {}
15
16 fn main() {
17     let x = *(Box::new(A) as Box<dyn Foo>);
18     assert_eq!(x.foo(), format!("hello"));
19
20     // I'm not sure whether we want this to work
21     let x = Box::new(A) as Box<dyn Foo>;
22     assert_eq!(x.foo(), format!("hello"));
23 }