]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/generics/wrong-number-of-args.rs
7 //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
8 //~| HELP remove these generics
10 type C
= Ty
<'
static, usize>;
11 //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
12 //~| ERROR this struct takes 0 type arguments but 1 type argument was supplied
13 //~| HELP remove this lifetime argument
14 //~| HELP remove this type argument
16 type D
= Ty
<'
static, usize, { 0 }
>;
17 //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
18 //~| ERROR this struct takes 0 generic arguments but 2 generic arguments were supplied
19 //~| HELP remove this lifetime argument
20 //~| HELP remove these generic arguments
27 //~^ ERROR missing generics for struct `type_and_type::Ty`
28 //~| HELP use angle brackets
31 //~^ ERROR this struct takes 2 type arguments but only 1 type argument was supplied
32 //~| HELP add missing type argument
34 type C
= Ty
<usize, String
>;
36 type D
= Ty
<usize, String
, char>;
37 //~^ ERROR this struct takes 2 type arguments but 3 type arguments were supplied
38 //~| HELP remove this type argument
41 mod lifetime_and_type
{
45 //~^ ERROR missing generics for struct `lifetime_and_type::Ty`
46 //~| ERROR missing lifetime specifier
47 //~| HELP consider introducing
48 //~| HELP use angle brackets
51 //~^ ERROR this struct takes 1 type argument but 0 type arguments were supplied
52 //~| HELP add missing type argument
55 //~^ ERROR missing lifetime specifier
56 //~| HELP consider introducing
58 type D
= Ty
<'
static, usize>;
61 mod type_and_type_and_type
{
62 struct Ty
<A
, B
, C
= &'
static str>;
65 //~^ ERROR missing generics for struct `type_and_type_and_type::Ty`
66 //~| HELP use angle brackets
69 //~^ ERROR this struct takes at least 2 type arguments but only 1 type argument was supplied
70 //~| HELP add missing type argument
72 type C
= Ty
<usize, String
>;
74 type D
= Ty
<usize, String
, char>;
76 type E
= Ty
<usize, String
, char, f64>;
77 //~^ ERROR this struct takes at most 3 type arguments but 4 type arguments were supplied
81 // Traits have an implicit `Self` type - these tests ensure we don't accidentally return it
82 // somewhere in the message
88 trait GenericLifetime
<'a
> {
92 trait GenericType
<A
> {
96 type A
= Box
<dyn NonGeneric
<usize>>;
97 //~^ ERROR this trait takes 0 type arguments but 1 type argument was supplied
100 type B
= Box
<dyn GenericLifetime
>;
101 //~^ ERROR missing lifetime specifier
102 //~| HELP consider introducing
104 type C
= Box
<dyn GenericLifetime
<'
static, '
static>>;
105 //~^ ERROR this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
108 type D
= Box
<dyn GenericType
>;
109 //~^ ERROR missing generics for trait `GenericType`
110 //~| HELP use angle brackets
112 type E
= Box
<dyn GenericType
<String
, usize>>;
113 //~^ ERROR this trait takes 1 type argument but 2 type arguments were supplied
119 use std
::collections
::HashMap
;
122 //~^ ERROR missing generics for struct `HashMap`
123 //~| HELP use angle brackets
125 type B
= HashMap
<String
>;
126 //~^ ERROR this struct takes at least 2 type arguments but only 1 type argument was supplied
127 //~| HELP add missing type argument
129 type C
= HashMap
<'
static>;
130 //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
131 //~| HELP remove these generics
132 //~| ERROR this struct takes at least 2 type arguments but 0 type arguments were supplied
133 //~| HELP add missing type arguments
135 type D
= HashMap
<usize, String
, char, f64>;
136 //~^ ERROR this struct takes at most 3 type arguments but 4 type arguments were supplied
137 //~| HELP remove this type argument
142 //~^ ERROR missing generics for enum `Result`
143 //~| HELP use angle brackets
145 type B
= Result
<String
>;
146 //~^ ERROR this enum takes 2 type arguments but only 1 type argument was supplied
147 //~| HELP add missing type argument
149 type C
= Result
<'
static>;
150 //~^ ERROR this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
151 //~| HELP remove these generics
152 //~| ERROR this enum takes 2 type arguments but 0 type arguments were supplied
153 //~| HELP add missing type arguments
155 type D
= Result
<usize, String
, char>;
156 //~^ ERROR this enum takes 2 type arguments but 3 type arguments were supplied