File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ struct A<const N: &u8>;
24
24
//~^ ERROR `&` without an explicit lifetime name cannot be used here
25
25
trait B {}
26
26
27
- impl<const N: &u8> A<N> {
27
+ impl<const N: &u8> A<N> {
28
28
//~^ ERROR `&` without an explicit lifetime name cannot be used here
29
29
fn foo<const M: &u8>(&self) {}
30
30
//~^ ERROR `&` without an explicit lifetime name cannot be used here
@@ -38,7 +38,7 @@ fn bar<const N: &u8>() {}
38
38
}
39
39
```
40
40
41
- Const generics cannot be borrowed without specifying a lifetime.The
41
+ Const generics cannot be borrowed without specifying a lifetime.The
42
42
compiler handles memory allocation of constants differently than that of
43
43
variables and it cannot infer the lifetime of the borrowed constant.
44
44
To fix this, explicitly specify a lifetime for the const generic.
You can’t perform that action at this time.
0 commit comments