diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index 0a26e6fc6d73a..89cd37e757fa2 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -469,6 +469,7 @@ hir_analysis_unrecognized_atomic_operation = hir_analysis_unrecognized_intrinsic_function = unrecognized intrinsic function: `{$name}` .label = unrecognized intrinsic + .help = if you're adding an intrinsic, be sure to update `check_intrinsic_type` hir_analysis_unused_associated_type_bounds = unnecessary associated type bound for not object safe associated type diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index 03ec8e163d694..d217d16ed8421 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -143,6 +143,7 @@ pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> { #[derive(Diagnostic)] #[diag(hir_analysis_unrecognized_intrinsic_function, code = E0093)] +#[help] pub struct UnrecognizedIntrinsicFunction { #[primary_span] #[label] diff --git a/tests/ui/error-codes/E0093.stderr b/tests/ui/error-codes/E0093.stderr index 387e0c55d4d29..51c367b343ab1 100644 --- a/tests/ui/error-codes/E0093.stderr +++ b/tests/ui/error-codes/E0093.stderr @@ -3,6 +3,8 @@ error[E0093]: unrecognized intrinsic function: `foo` | LL | fn foo(); | ^^^^^^^^^ unrecognized intrinsic + | + = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type` error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-abi.stderr b/tests/ui/feature-gates/feature-gate-abi.stderr index aa60434d9fe6c..3fd1e1189abc7 100644 --- a/tests/ui/feature-gates/feature-gate-abi.stderr +++ b/tests/ui/feature-gates/feature-gate-abi.stderr @@ -187,12 +187,16 @@ error[E0093]: unrecognized intrinsic function: `f1` | LL | extern "rust-intrinsic" fn f1() {} | ^^ unrecognized intrinsic + | + = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type` error[E0093]: unrecognized intrinsic function: `f2` --> $DIR/feature-gate-abi.rs:18:32 | LL | extern "platform-intrinsic" fn f2() {} | ^^ unrecognized intrinsic + | + = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type` error: intrinsic must be in `extern "rust-intrinsic" { ... }` block --> $DIR/feature-gate-abi.rs:25:32 diff --git a/tests/ui/feature-gates/feature-gate-intrinsics.stderr b/tests/ui/feature-gates/feature-gate-intrinsics.stderr index 78c21843adb08..583a4a1a84eb0 100644 --- a/tests/ui/feature-gates/feature-gate-intrinsics.stderr +++ b/tests/ui/feature-gates/feature-gate-intrinsics.stderr @@ -21,12 +21,16 @@ error[E0093]: unrecognized intrinsic function: `bar` | LL | fn bar(); | ^^^^^^^^^ unrecognized intrinsic + | + = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type` error[E0093]: unrecognized intrinsic function: `baz` --> $DIR/feature-gate-intrinsics.rs:5:28 | LL | extern "rust-intrinsic" fn baz() {} | ^^^ unrecognized intrinsic + | + = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type` error: intrinsic must be in `extern "rust-intrinsic" { ... }` block --> $DIR/feature-gate-intrinsics.rs:5:34 diff --git a/tests/ui/intrinsics-always-extern.stderr b/tests/ui/intrinsics-always-extern.stderr index 32468f99197f3..1f7bb5a3b0de2 100644 --- a/tests/ui/intrinsics-always-extern.stderr +++ b/tests/ui/intrinsics-always-extern.stderr @@ -9,6 +9,8 @@ error[E0093]: unrecognized intrinsic function: `hello` | LL | extern "rust-intrinsic" fn hello() { | ^^^^^ unrecognized intrinsic + | + = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type` error: intrinsic must be in `extern "rust-intrinsic" { ... }` block --> $DIR/intrinsics-always-extern.rs:8:43