Structured suggestion for "missing feature intrinsic"
```
error: `size_of_val` is not yet stable as a const intrinsic
--> $DIR/const-unstable-intrinsic.rs:17:9
|
LL | unstable_intrinsic::size_of_val(&x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(unstable)]` to the crate attributes to enable
help: add `#![feature(unstable)]` to the crate attributes to enable
|
LL + #![feature("unstable")]
|
```
This commit is contained in:
@@ -123,12 +123,19 @@ pub(crate) struct UnstableConstFn {
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(const_eval_unstable_intrinsic)]
|
||||
#[help]
|
||||
pub(crate) struct UnstableIntrinsic {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub name: Symbol,
|
||||
pub feature: Symbol,
|
||||
#[suggestion(
|
||||
const_eval_unstable_intrinsic_suggestion,
|
||||
code = "#![feature({feature})]\n",
|
||||
applicability = "machine-applicable"
|
||||
)]
|
||||
pub suggestion: Option<Span>,
|
||||
#[help(const_eval_unstable_intrinsic_suggestion)]
|
||||
pub help: bool,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
||||
Reference in New Issue
Block a user