about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/check_consts/ops.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-12-28 18:37:16 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-01-18 21:15:37 +0000
commit7175da59d3ce56ededb142385dbbf95a2f6ad1ed (patch)
tree39e64b757ae8a74892c59ef0e64eaf0dbc000ec9 /compiler/rustc_const_eval/src/check_consts/ops.rs
parenta47fee50bd2740caa91b6d658fa6e808466de5a5 (diff)
downloadrust-7175da59d3ce56ededb142385dbbf95a2f6ad1ed.tar.gz
rust-7175da59d3ce56ededb142385dbbf95a2f6ad1ed.zip
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")]
   |
```
Diffstat (limited to 'compiler/rustc_const_eval/src/check_consts/ops.rs')
-rw-r--r--compiler/rustc_const_eval/src/check_consts/ops.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/check_consts/ops.rs b/compiler/rustc_const_eval/src/check_consts/ops.rs
index 6a7da13b303..3c83a7b92cd 100644
--- a/compiler/rustc_const_eval/src/check_consts/ops.rs
+++ b/compiler/rustc_const_eval/src/check_consts/ops.rs
@@ -447,6 +447,7 @@ pub(crate) struct IntrinsicUnstable {
     pub name: Symbol,
     pub feature: Symbol,
     pub const_stable_indirect: bool,
+    pub suggestion: Option<Span>,
 }
 
 impl<'tcx> NonConstOp<'tcx> for IntrinsicUnstable {
@@ -466,6 +467,8 @@ impl<'tcx> NonConstOp<'tcx> for IntrinsicUnstable {
             span,
             name: self.name,
             feature: self.feature,
+            suggestion: self.suggestion,
+            help: self.suggestion.is_none(),
         })
     }
 }