2024-12-04 20:49:05 +00:00
|
|
|
error[E0158]: constant pattern cannot depend on generic parameters
|
2020-09-23 08:39:19 +10:00
|
|
|
--> $DIR/issue-73976-polymorphic.rs:20:37
|
2020-07-21 02:28:51 +01:00
|
|
|
|
|
2024-11-20 02:15:21 +00:00
|
|
|
LL | impl<T: 'static> GetTypeId<T> {
|
|
|
|
|
| -----------------------------
|
|
|
|
|
LL | pub const VALUE: TypeId = TypeId::of::<T>();
|
|
|
|
|
| ----------------------- constant defined here
|
|
|
|
|
...
|
2024-11-20 03:08:52 +00:00
|
|
|
LL | const fn check_type_id<T: 'static>() -> bool {
|
2024-12-04 20:49:05 +00:00
|
|
|
| - constant depends on this generic parameter
|
2020-07-21 02:28:51 +01:00
|
|
|
LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
|
2024-11-20 03:08:52 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ `const` depends on a generic parameter
|
2020-07-21 02:28:51 +01:00
|
|
|
|
2024-12-04 20:49:05 +00:00
|
|
|
error[E0158]: constant pattern cannot depend on generic parameters
|
2023-02-27 17:43:39 +00:00
|
|
|
--> $DIR/issue-73976-polymorphic.rs:31:42
|
2020-07-21 02:28:51 +01:00
|
|
|
|
|
2024-11-20 02:15:21 +00:00
|
|
|
LL | impl<T: 'static> GetTypeNameLen<T> {
|
|
|
|
|
| ----------------------------------
|
|
|
|
|
LL | pub const VALUE: usize = any::type_name::<T>().len();
|
|
|
|
|
| ---------------------- constant defined here
|
|
|
|
|
...
|
2024-11-20 03:08:52 +00:00
|
|
|
LL | const fn check_type_name_len<T: 'static>() -> bool {
|
2024-12-04 20:49:05 +00:00
|
|
|
| - constant depends on this generic parameter
|
2020-07-21 02:28:51 +01:00
|
|
|
LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
|
2024-11-20 03:08:52 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `const` depends on a generic parameter
|
2020-07-21 02:28:51 +01:00
|
|
|
|
2023-02-27 17:43:39 +00:00
|
|
|
error: aborting due to 2 previous errors
|
2020-07-21 02:28:51 +01:00
|
|
|
|
2024-07-13 18:32:10 +02:00
|
|
|
For more information about this error, try `rustc --explain E0158`.
|