]>
Commit | Line | Data |
---|---|---|
353b0b11 FG |
1 | // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty |
2 | // revisions: current next | |
3 | ||
f2b60f7d FG |
4 | #![feature(return_position_impl_trait_in_trait)] |
5 | #![allow(incomplete_features)] | |
6 | ||
7 | use std::fmt::Debug; | |
8 | ||
9 | trait Foo { | |
10 | fn baz(&self) -> impl Debug; | |
11 | } | |
12 | ||
13 | impl Foo for u32 { | |
14 | fn baz(&self) -> u32 { | |
15 | 32 | |
16 | } | |
17 | } | |
18 | ||
19 | fn main() { | |
20 | let i = Box::new(42_u32) as Box<dyn Foo>; | |
21 | //~^ ERROR the trait `Foo` cannot be made into an object | |
22 | //~| ERROR the trait `Foo` cannot be made into an object | |
23 | let s = i.baz(); | |
24 | //~^ ERROR the trait `Foo` cannot be made into an object | |
25 | } |