From 30ff127036b685aca52d121807d13e8e1d2db684 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Fri, 16 Jun 2023 20:20:39 +0000 Subject: [PATCH] Re-use error code for duplicate error --- compiler/rustc_ty_utils/src/errors.rs | 2 +- tests/ui/type-alias-impl-trait/multi-error.stderr | 3 ++- tests/ui/type-alias-impl-trait/non-defining-method.stderr | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_ty_utils/src/errors.rs b/compiler/rustc_ty_utils/src/errors.rs index 553bf40ef3a..947d4bbe86e 100644 --- a/compiler/rustc_ty_utils/src/errors.rs +++ b/compiler/rustc_ty_utils/src/errors.rs @@ -113,7 +113,7 @@ pub struct DuplicateArg<'tcx> { } #[derive(Diagnostic)] -#[diag(ty_utils_impl_trait_not_param)] +#[diag(ty_utils_impl_trait_not_param, code = "E0792")] pub struct NotParam<'tcx> { pub arg: GenericArg<'tcx>, #[primary_span] diff --git a/tests/ui/type-alias-impl-trait/multi-error.stderr b/tests/ui/type-alias-impl-trait/multi-error.stderr index 6d8fa0fb021..b2de2effea6 100644 --- a/tests/ui/type-alias-impl-trait/multi-error.stderr +++ b/tests/ui/type-alias-impl-trait/multi-error.stderr @@ -1,4 +1,4 @@ -error: non-defining opaque type use in defining scope +error[E0792]: non-defining opaque type use in defining scope --> $DIR/multi-error.rs:17:17 | LL | fn foo() -> (Self::Bar, Self::Baz) { @@ -12,3 +12,4 @@ LL | type Bar = impl Sized; error: aborting due to previous error +For more information about this error, try `rustc --explain E0792`. diff --git a/tests/ui/type-alias-impl-trait/non-defining-method.stderr b/tests/ui/type-alias-impl-trait/non-defining-method.stderr index 61bf2da20db..ed5590f9d71 100644 --- a/tests/ui/type-alias-impl-trait/non-defining-method.stderr +++ b/tests/ui/type-alias-impl-trait/non-defining-method.stderr @@ -1,4 +1,4 @@ -error: non-defining opaque type use in defining scope +error[E0792]: non-defining opaque type use in defining scope --> $DIR/non-defining-method.rs:16:17 | LL | fn foo() -> Self::Bar {} @@ -12,3 +12,4 @@ LL | type Bar = impl Sized; error: aborting due to previous error +For more information about this error, try `rustc --explain E0792`.