error[E0158]: constant pattern cannot depend on generic parameters --> $DIR/issue-73976-polymorphic.rs:20:37 | LL | impl GetTypeId { | ----------------------------- LL | pub const VALUE: TypeId = TypeId::of::(); | ----------------------- constant defined here ... LL | const fn check_type_id() -> bool { | - constant depends on this generic parameter LL | matches!(GetTypeId::::VALUE, GetTypeId::::VALUE) | ^^^^^^^^^^^^^^^^^^^^^ `const` depends on a generic parameter error[E0158]: constant pattern cannot depend on generic parameters --> $DIR/issue-73976-polymorphic.rs:31:42 | LL | impl GetTypeNameLen { | ---------------------------------- LL | pub const VALUE: usize = any::type_name::().len(); | ---------------------- constant defined here ... LL | const fn check_type_name_len() -> bool { | - constant depends on this generic parameter LL | matches!(GetTypeNameLen::::VALUE, GetTypeNameLen::::VALUE) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `const` depends on a generic parameter error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0158`.