]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/bad-assoc-ty.rs
Auto merge of #46838 - pnkfelix:issue-46112-followup, r=estebank
[rust.git] / src / test / ui / did_you_mean / bad-assoc-ty.rs
1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 type A = [u8; 4]::AssocTy;
12 //~^ ERROR missing angle brackets in associated item path
13 //~| ERROR ambiguous associated type
14
15 type B = [u8]::AssocTy;
16 //~^ ERROR missing angle brackets in associated item path
17 //~| ERROR ambiguous associated type
18
19 type C = (u8)::AssocTy;
20 //~^ ERROR missing angle brackets in associated item path
21 //~| ERROR ambiguous associated type
22
23 type D = (u8, u8)::AssocTy;
24 //~^ ERROR missing angle brackets in associated item path
25 //~| ERROR ambiguous associated type
26
27 type E = _::AssocTy;
28 //~^ ERROR missing angle brackets in associated item path
29 //~| ERROR the type placeholder `_` is not allowed within types on item signatures
30
31 type F = &'static (u8)::AssocTy;
32 //~^ ERROR missing angle brackets in associated item path
33 //~| ERROR ambiguous associated type
34
35 // Qualified paths cannot appear in bounds, so the recovery
36 // should apply to the whole sum and not `(Send)`.
37 type G = 'static + (Send)::AssocTy;
38 //~^ ERROR missing angle brackets in associated item path
39 //~| ERROR ambiguous associated type
40
41 // This is actually a legal path with fn-like generic arguments in the middle!
42 // Recovery should not apply in this context.
43 type H = Fn(u8) -> (u8)::Output;
44 //~^ ERROR ambiguous associated type
45
46 fn main() {}