]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/type-alias-where-fixable.rs
Auto merge of #100678 - GuillaumeGomez:improve-rustdoc-json-tests, r=aDotInTheVoid
[rust.git] / src / test / ui / parser / type-alias-where-fixable.rs
1 // check-pass
2 // run-rustfix
3
4 #![feature(generic_associated_types)]
5
6 trait Trait {
7     // Fine.
8     type Assoc where u32: Copy;
9     // Fine.
10     type Assoc2 where u32: Copy, i32: Copy;
11 }
12
13 impl Trait for u32 {
14     // Not fine, suggests moving.
15     type Assoc where u32: Copy = ();
16     //~^ WARNING where clause not allowed here
17     // Not fine, suggests moving `u32: Copy`
18     type Assoc2 where u32: Copy = () where i32: Copy;
19     //~^ WARNING where clause not allowed here
20 }
21
22 impl Trait for i32 {
23     // Fine.
24     type Assoc = () where u32: Copy;
25     // Not fine, suggests moving both.
26     type Assoc2 where u32: Copy, i32: Copy = ();
27     //~^ WARNING where clause not allowed here
28 }
29
30 fn main() {}