about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-06-16 20:20:39 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-06-22 15:51:14 +0000
commit30ff127036b685aca52d121807d13e8e1d2db684 (patch)
tree0de2daf3d6f6e686a4f1e9e42eacad18ec8a038b
parentd6e1b206238d032a0d13fe66e316664a7c03ded3 (diff)
downloadrust-30ff127036b685aca52d121807d13e8e1d2db684.tar.gz
rust-30ff127036b685aca52d121807d13e8e1d2db684.zip
Re-use error code for duplicate error
-rw-r--r--compiler/rustc_ty_utils/src/errors.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/multi-error.stderr3
-rw-r--r--tests/ui/type-alias-impl-trait/non-defining-method.stderr3
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<u32>, Self::Baz) {
@@ -12,3 +12,4 @@ LL |     type Bar<T> = 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<u32> {}
@@ -12,3 +12,4 @@ LL |     type Bar<T> = impl Sized;
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0792`.