2020-10-12 22:27:59 +01:00
|
|
|
error: generic parameters may not be used in const operations
|
2024-02-15 17:12:05 +00:00
|
|
|
--> $DIR/issue-68366.rs:12:37
|
2020-09-09 13:28:41 +02:00
|
|
|
|
|
|
|
|
|
LL | impl <const N: usize> Collatz<{Some(N)}> {}
|
2020-10-11 16:47:45 +01:00
|
|
|
| ^ cannot perform const operation using `N`
|
2020-09-09 13:28:41 +02:00
|
|
|
|
|
2020-10-12 22:27:59 +01:00
|
|
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
|
2023-11-30 20:59:51 +01:00
|
|
|
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
|
2020-09-09 13:28:41 +02:00
|
|
|
|
2024-02-15 17:12:05 +00:00
|
|
|
error: `Option<usize>` is forbidden as the type of a const generic parameter
|
|
|
|
|
--> $DIR/issue-68366.rs:9:25
|
|
|
|
|
|
|
|
|
|
|
LL | struct Collatz<const N: Option<usize>>;
|
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
2024-09-29 15:28:11 -05:00
|
|
|
= note: the only supported types are integers, `bool`, and `char`
|
2024-03-07 22:09:00 +00:00
|
|
|
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
|
|
|
|
|
|
|
|
|
|
LL + #![feature(adt_const_params)]
|
|
|
|
|
|
|
2024-02-15 17:12:05 +00:00
|
|
|
|
2020-09-06 04:34:20 +00:00
|
|
|
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
|
2024-02-15 17:12:05 +00:00
|
|
|
--> $DIR/issue-68366.rs:12:7
|
2020-09-06 04:34:20 +00:00
|
|
|
|
|
|
|
|
|
LL | impl <const N: usize> Collatz<{Some(N)}> {}
|
2022-04-04 12:16:20 -07:00
|
|
|
| ^^^^^^^^^^^^^^ unconstrained const parameter
|
2020-09-06 04:34:20 +00:00
|
|
|
|
|
|
|
|
|
= note: expressions using a const parameter must map each value to a distinct output value
|
|
|
|
|
= note: proving the result of expressions other than the parameter are unique is not supported
|
|
|
|
|
|
|
|
|
|
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
|
2024-02-15 17:12:05 +00:00
|
|
|
--> $DIR/issue-68366.rs:19:6
|
2020-09-06 04:34:20 +00:00
|
|
|
|
|
|
|
|
|
LL | impl<const N: usize> Foo {}
|
2022-04-04 12:16:20 -07:00
|
|
|
| ^^^^^^^^^^^^^^ unconstrained const parameter
|
2020-09-06 04:34:20 +00:00
|
|
|
|
|
|
|
|
|
= note: expressions using a const parameter must map each value to a distinct output value
|
|
|
|
|
= note: proving the result of expressions other than the parameter are unique is not supported
|
|
|
|
|
|
2024-02-15 17:12:05 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2020-09-06 04:34:20 +00:00
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0207`.
|