summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/min_const_generics/complex-expression.stderr
blob: 3affdcf9b03ea7561be1023d7f8ffb8ac2b8fc1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
error: generic parameters may not be used in const operations
  --> $DIR/complex-expression.rs:10:38
   |
LL | struct Break0<const N: usize>([u8; { N + 1 }]);
   |                                      ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions

error: generic parameters may not be used in const operations
  --> $DIR/complex-expression.rs:13:40
   |
LL | struct Break1<const N: usize>([u8; { { N } }]);
   |                                        ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions

error: generic parameters may not be used in const operations
  --> $DIR/complex-expression.rs:17:17
   |
LL |     let _: [u8; N + 1];
   |                 ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions

error: generic parameters may not be used in const operations
  --> $DIR/complex-expression.rs:22:17
   |
LL |     let _ = [0; N + 1];
   |                 ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions

error: generic parameters may not be used in const operations
  --> $DIR/complex-expression.rs:26:45
   |
LL | struct BreakTy0<T>(T, [u8; { size_of::<*mut T>() }]);
   |                                             ^ cannot perform const operation using `T`
   |
   = note: type parameters may not be used in const expressions
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions

error: generic parameters may not be used in const operations
  --> $DIR/complex-expression.rs:29:47
   |
LL | struct BreakTy1<T>(T, [u8; { { size_of::<*mut T>() } }]);
   |                                               ^ cannot perform const operation using `T`
   |
   = note: type parameters may not be used in const expressions
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions

error: generic parameters may not be used in const operations
  --> $DIR/complex-expression.rs:33:32
   |
LL |     let _: [u8; size_of::<*mut T>() + 1];
   |                                ^ cannot perform const operation using `T`
   |
   = note: type parameters may not be used in const expressions
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions

warning: cannot use constants which depend on generic parameters in types
  --> $DIR/complex-expression.rs:38:17
   |
LL |     let _ = [0; size_of::<*mut T>() + 1];
   |                 ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
   = note: `#[warn(const_evaluatable_unchecked)]` on by default

error: aborting due to 7 previous errors; 1 warning emitted