]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/min_const_generics/complex-expression.stderr
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / const-generics / min_const_generics / complex-expression.stderr
1 error: generic parameters may not be used in const operations
2 --> $DIR/complex-expression.rs:11:38
3 |
4 LL | struct Break0<const N: usize>([u8; { N + 1 }]);
5 | ^ cannot perform const operation using `N`
6 |
7 = help: const parameters may only be used as standalone arguments, i.e. `N`
8
9 error: generic parameters may not be used in const operations
10 --> $DIR/complex-expression.rs:14:40
11 |
12 LL | struct Break1<const N: usize>([u8; { { N } }]);
13 | ^ cannot perform const operation using `N`
14 |
15 = help: const parameters may only be used as standalone arguments, i.e. `N`
16
17 error: generic parameters may not be used in const operations
18 --> $DIR/complex-expression.rs:18:17
19 |
20 LL | let _: [u8; N + 1];
21 | ^ cannot perform const operation using `N`
22 |
23 = help: const parameters may only be used as standalone arguments, i.e. `N`
24
25 error: generic parameters may not be used in const operations
26 --> $DIR/complex-expression.rs:23:17
27 |
28 LL | let _ = [0; N + 1];
29 | ^ cannot perform const operation using `N`
30 |
31 = help: const parameters may only be used as standalone arguments, i.e. `N`
32
33 error: generic parameters may not be used in const operations
34 --> $DIR/complex-expression.rs:27:45
35 |
36 LL | struct BreakTy0<T>(T, [u8; { size_of::<*mut T>() }]);
37 | ^ cannot perform const operation using `T`
38 |
39 = note: type parameters may not be used in const expressions
40
41 error: generic parameters may not be used in const operations
42 --> $DIR/complex-expression.rs:30:47
43 |
44 LL | struct BreakTy1<T>(T, [u8; { { size_of::<*mut T>() } }]);
45 | ^ cannot perform const operation using `T`
46 |
47 = note: type parameters may not be used in const expressions
48
49 error: generic parameters may not be used in const operations
50 --> $DIR/complex-expression.rs:34:32
51 |
52 LL | let _: [u8; size_of::<*mut T>() + 1];
53 | ^ cannot perform const operation using `T`
54 |
55 = note: type parameters may not be used in const expressions
56
57 warning: cannot use constants which depend on generic parameters in types
58 --> $DIR/complex-expression.rs:39:17
59 |
60 LL | let _ = [0; size_of::<*mut T>() + 1];
61 | ^^^^^^^^^^^^^^^^^^^^^^^
62 |
63 = note: `#[warn(const_evaluatable_unchecked)]` on by default
64 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
65 = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
66
67 error: aborting due to 7 previous errors; 1 warning emitted
68