Suggest to add missing feature when using gated const features

This commit is contained in:
mibac138 2020-05-04 23:33:10 +02:00
parent d626e4dadc
commit 73867365a8
15 changed files with 70 additions and 0 deletions

View file

@ -12,6 +12,7 @@ error[E0019]: constant contains unimplemented expression type
LL | const CON : Box<i32> = box 0;
| ^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
= note: A function call isn't allowed in the const's initialization expression because the expression's value must be known at compile-time.
= note: Remember: you can't use a function call inside a const's initialization expression! However, you can use it anywhere else.

View file

@ -9,6 +9,8 @@ error[E0019]: constant contains unimplemented expression type
|
LL | const CON : Box<i32> = box 0;
| ^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error: aborting due to 2 previous errors

View file

@ -12,6 +12,8 @@ error[E0019]: static contains unimplemented expression type
|
LL | static STATIC_REF: &'static mut i32 = &mut X;
| ^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0658]: references in statics may only refer to immutable values
--> $DIR/E0017.rs:6:39

View file

@ -12,6 +12,8 @@ error[E0019]: static contains unimplemented expression type
|
LL | static STATIC_REF: &'static mut i32 = &mut X;
| ^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0658]: references in statics may only refer to immutable values
--> $DIR/E0388.rs:5:39