@@ -7,7 +7,7 @@ LL | pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "
7
7
= note: type parameters may not be used in the type of const parameters
8
8
9
9
error[E0770]: the type of const parameters must not depend on other generic parameters
10
- --> $DIR/issue-71381.rs:23 :40
10
+ --> $DIR/issue-71381.rs:24 :40
11
11
|
12
12
LL | const FN: unsafe extern "C" fn(Args),
13
13
| ^^^^ the type must not depend on the parameter `Args`
@@ -23,13 +23,25 @@ LL | pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "
23
23
= note: the only supported types are integers, `bool` and `char`
24
24
25
25
error: using function pointers as const generic parameters is forbidden
26
- --> $DIR/issue-71381.rs:23 :19
26
+ --> $DIR/issue-71381.rs:24 :19
27
27
|
28
28
LL | const FN: unsafe extern "C" fn(Args),
29
29
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
30
30
|
31
31
= note: the only supported types are integers, `bool` and `char`
32
32
33
- error: aborting due to 4 previous errors
33
+ error[E0594]: cannot assign to `self.0`, which is behind a `&` reference
34
+ --> $DIR/issue-71381.rs:17:9
35
+ |
36
+ LL | self.0 = Self::trampiline::<Args, IDX, FN> as _
37
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written
38
+ |
39
+ help: consider changing this to be a mutable reference
40
+ |
41
+ LL | pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&mut self) {
42
+ | ~~~~~~~~~
43
+
44
+ error: aborting due to 5 previous errors
34
45
35
- For more information about this error, try `rustc --explain E0770`.
46
+ Some errors have detailed explanations: E0594, E0770.
47
+ For more information about an error, try `rustc --explain E0594`.
0 commit comments