about summary refs log tree commit diff
path: root/tests/ui/consts/issue-73976-polymorphic.stderr
blob: 41a5e804c676d8b847e0b979ab7419b69f641e0e (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
error[E0158]: constant pattern cannot depend on generic parameters
  --> $DIR/issue-73976-polymorphic.rs:19:37
   |
LL | impl<T: 'static> GetTypeId<T> {
   | -----------------------------
LL |     pub const VALUE: TypeId = TypeId::of::<T>();
   |     ----------------------- constant defined here
...
LL | const fn check_type_id<T: 'static>() -> bool {
   |                        - constant depends on this generic parameter
LL |     matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
   |                                     ^^^^^^^^^^^^^^^^^^^^^ `const` depends on a generic parameter

error[E0158]: constant pattern cannot depend on generic parameters
  --> $DIR/issue-73976-polymorphic.rs:30:42
   |
LL | impl<T: 'static> GetTypeNameLen<T> {
   | ----------------------------------
LL |     pub const VALUE: usize = any::type_name::<T>().len();
   |     ---------------------- constant defined here
...
LL | const fn check_type_name_len<T: 'static>() -> bool {
   |                              - constant depends on this generic parameter
LL |     matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^ `const` depends on a generic parameter

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0158`.