]> git.lizzy.rs Git - rust.git/blob - src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.stderr
Rollup merge of #99079 - compiler-errors:issue-99073, r=oli-obk
[rust.git] / src / test / ui / invalid / invalid-rustc_legacy_const_generics-arguments.stderr
1 error: suffixed literals are not allowed in attributes
2   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:21:31
3    |
4 LL | #[rustc_legacy_const_generics(0usize)]
5    |                               ^^^^^^
6    |
7    = help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
8
9 error: malformed `rustc_legacy_const_generics` attribute input
10   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:37:1
11    |
12 LL | #[rustc_legacy_const_generics]
13    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
14
15 error: malformed `rustc_legacy_const_generics` attribute input
16   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:40:1
17    |
18 LL | #[rustc_legacy_const_generics = 1]
19    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
20
21 error: #[rustc_legacy_const_generics] must have one index for each generic parameter
22   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:3:1
23    |
24 LL | #[rustc_legacy_const_generics(0)]
25    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 LL | fn foo1() {}
27    |        - generic parameters
28
29 error: index exceeds number of arguments
30   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:6:31
31    |
32 LL | #[rustc_legacy_const_generics(1)]
33    |                               ^ there is only 1 argument
34
35 error: index exceeds number of arguments
36   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:9:31
37    |
38 LL | #[rustc_legacy_const_generics(2)]
39    |                               ^ there are only 2 arguments
40
41 error: arguments should be non-negative integers
42   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:12:31
43    |
44 LL | #[rustc_legacy_const_generics(a)]
45    |                               ^
46
47 error: arguments should be non-negative integers
48   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:15:34
49    |
50 LL | #[rustc_legacy_const_generics(1, a, 2, b)]
51    |                                  ^     ^
52
53 error: attribute should be applied to a function definition
54   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:18:1
55    |
56 LL | #[rustc_legacy_const_generics(0)]
57    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58 LL | struct S;
59    | --------- not a function definition
60
61 error: #[rustc_legacy_const_generics] functions must only have const generics
62   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:29:1
63    |
64 LL | #[rustc_legacy_const_generics(0)]
65    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 LL | fn foo8<X>() {}
67    |         - non-const generic parameter
68
69 error: attribute should be applied to a function definition
70   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:33:5
71    |
72 LL |     #[rustc_legacy_const_generics(0)]
73    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74 LL |     fn foo9<const X: usize>() {}
75    |     ---------------------------- not a function definition
76
77 error: attribute should be applied to a function definition
78   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:25:5
79    |
80 LL |     #[rustc_legacy_const_generics(1)]
81    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82 LL |     fn foo7<const X: usize>();
83    |     -------------------------- not a function definition
84
85 error[E0044]: foreign items may not have const parameters
86   --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:26:5
87    |
88 LL |     fn foo7<const X: usize>();
89    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't have const parameters
90    |
91    = help: replace the const parameters with concrete consts
92
93 error: aborting due to 13 previous errors
94
95 For more information about this error, try `rustc --explain E0044`.