2020-10-12 16:27:59 -05:00
|
|
|
error: generic parameters may not be used in const operations
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:9:38
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
|
|
|
LL | struct Break0<const N: usize>([u8; { N + 1 }]);
|
2020-10-11 10:47:45 -05:00
|
|
|
| ^ cannot perform const operation using `N`
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
2020-10-12 16:27:59 -05:00
|
|
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
|
2021-08-25 04:21:39 -05:00
|
|
|
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-07-28 08:55:42 -05:00
|
|
|
|
2020-10-12 16:27:59 -05:00
|
|
|
error: generic parameters may not be used in const operations
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:12:40
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
|
|
|
LL | struct Break1<const N: usize>([u8; { { N } }]);
|
2020-10-11 10:47:45 -05:00
|
|
|
| ^ cannot perform const operation using `N`
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
2020-10-12 16:27:59 -05:00
|
|
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
|
2021-08-25 04:21:39 -05:00
|
|
|
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-07-28 08:55:42 -05:00
|
|
|
|
2020-10-12 16:27:59 -05:00
|
|
|
error: generic parameters may not be used in const operations
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:16:17
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
|
|
|
LL | let _: [u8; N + 1];
|
2020-10-11 10:47:45 -05:00
|
|
|
| ^ cannot perform const operation using `N`
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
2020-10-12 16:27:59 -05:00
|
|
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
|
2021-08-25 04:21:39 -05:00
|
|
|
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-07-28 08:55:42 -05:00
|
|
|
|
2020-10-12 16:27:59 -05:00
|
|
|
error: generic parameters may not be used in const operations
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:21:17
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
|
|
|
LL | let _ = [0; N + 1];
|
2020-10-11 10:47:45 -05:00
|
|
|
| ^ cannot perform const operation using `N`
|
2020-07-28 08:55:42 -05:00
|
|
|
|
|
2020-10-12 16:27:59 -05:00
|
|
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
|
2021-08-25 04:21:39 -05:00
|
|
|
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-07-28 08:55:42 -05:00
|
|
|
|
2020-10-22 03:32:41 -05:00
|
|
|
error: generic parameters may not be used in const operations
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:25:45
|
2020-10-22 03:32:41 -05:00
|
|
|
|
|
|
|
|
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
|
2021-08-25 04:21:39 -05:00
|
|
|
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-10-22 03:32:41 -05:00
|
|
|
|
|
|
|
error: generic parameters may not be used in const operations
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:28:47
|
2020-10-22 03:32:41 -05:00
|
|
|
|
|
|
|
|
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
|
2021-08-25 04:21:39 -05:00
|
|
|
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-10-22 03:32:41 -05:00
|
|
|
|
|
|
|
error: generic parameters may not be used in const operations
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:32:32
|
2020-10-22 03:32:41 -05:00
|
|
|
|
|
|
|
|
LL | let _: [u8; size_of::<*mut T>() + 1];
|
|
|
|
| ^ cannot perform const operation using `T`
|
|
|
|
|
|
|
|
|
= note: type parameters may not be used in const expressions
|
2021-08-25 04:21:39 -05:00
|
|
|
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-10-22 03:32:41 -05:00
|
|
|
|
|
|
|
warning: cannot use constants which depend on generic parameters in types
|
2020-11-17 04:44:21 -06:00
|
|
|
--> $DIR/complex-expression.rs:37:17
|
2020-10-22 03:32:41 -05:00
|
|
|
|
|
|
|
|
LL | let _ = [0; size_of::<*mut T>() + 1];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `#[warn(const_evaluatable_unchecked)]` on by default
|
|
|
|
= 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>
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors; 1 warning emitted
|
2020-07-28 08:55:42 -05:00
|
|
|
|