]>
Commit | Line | Data |
---|---|---|
29967ef6 | 1 | // ignore-compare-mode-chalk |
60c5eb7d XL |
2 | use std::fmt::Debug; |
3 | ||
4 | type Foo = impl Debug; //~ ERROR `impl Trait` in type aliases is unstable | |
416331ca XL |
5 | |
6 | trait Bar { | |
60c5eb7d | 7 | type Baa: Debug; |
416331ca XL |
8 | fn define() -> Self::Baa; |
9 | } | |
10 | ||
11 | impl Bar for () { | |
60c5eb7d | 12 | type Baa = impl Debug; //~ ERROR `impl Trait` in type aliases is unstable |
f035d41b XL |
13 | fn define() -> Self::Baa { |
14 | 0 | |
15 | } | |
416331ca XL |
16 | } |
17 | ||
f035d41b XL |
18 | fn define() -> Foo { |
19 | 0 | |
20 | } | |
416331ca | 21 | |
60c5eb7d XL |
22 | trait TraitWithDefault { |
23 | type Assoc = impl Debug; | |
24 | //~^ ERROR associated type defaults are unstable | |
25 | //~| ERROR `impl Trait` not allowed outside of function | |
26 | //~| ERROR `impl Trait` in type aliases is unstable | |
27 | } | |
28 | ||
29 | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>); | |
30 | //~^ ERROR `impl Trait` in type aliases is unstable | |
31 | //~| ERROR `impl Trait` in type aliases is unstable | |
32 | //~| ERROR `impl Trait` in type aliases is unstable | |
33 | //~| ERROR `impl Trait` in type aliases is unstable | |
f035d41b XL |
34 | |
35 | fn define_multiple() -> NestedFree { | |
36 | (vec![true], 0u8, 0i32..1) | |
37 | } | |
60c5eb7d XL |
38 | |
39 | impl Bar for u8 { | |
f035d41b | 40 | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug); |
60c5eb7d XL |
41 | //~^ ERROR `impl Trait` in type aliases is unstable |
42 | //~| ERROR `impl Trait` in type aliases is unstable | |
43 | //~| ERROR `impl Trait` in type aliases is unstable | |
44 | //~| ERROR `impl Trait` in type aliases is unstable | |
f035d41b XL |
45 | fn define() -> Self::Baa { |
46 | (vec![true], 0u8, 0i32..1) | |
47 | } | |
60c5eb7d XL |
48 | } |
49 | ||
416331ca | 50 | fn main() {} |