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>;
2424//~^ ERROR `&` without an explicit lifetime name cannot be used here
2525trait B {}
2626
27- impl<const N: &u8> A<N> {
27+ impl<const N: &u8> A<N> {
2828//~^ ERROR `&` without an explicit lifetime name cannot be used here
2929 fn foo<const M: &u8>(&self) {}
3030 //~^ ERROR `&` without an explicit lifetime name cannot be used here
@@ -38,7 +38,7 @@ fn bar<const N: &u8>() {}
3838}
3939```
4040
41- Const generics cannot be borrowed without specifying a lifetime.The
41+ Const generics cannot be borrowed without specifying a lifetime.The
4242compiler handles memory allocation of constants differently than that of
4343variables and it cannot infer the lifetime of the borrowed constant.
4444To fix this, explicitly specify a lifetime for the const generic.
You can’t perform that action at this time.
0 commit comments