Skip to content

Commit 30ff127

Browse files
committed
Re-use error code for duplicate error
1 parent d6e1b20 commit 30ff127

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

compiler/rustc_ty_utils/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub struct DuplicateArg<'tcx> {
113113
}
114114

115115
#[derive(Diagnostic)]
116-
#[diag(ty_utils_impl_trait_not_param)]
116+
#[diag(ty_utils_impl_trait_not_param, code = "E0792")]
117117
pub struct NotParam<'tcx> {
118118
pub arg: GenericArg<'tcx>,
119119
#[primary_span]

tests/ui/type-alias-impl-trait/multi-error.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: non-defining opaque type use in defining scope
1+
error[E0792]: non-defining opaque type use in defining scope
22
--> $DIR/multi-error.rs:17:17
33
|
44
LL | fn foo() -> (Self::Bar<u32>, Self::Baz) {
@@ -12,3 +12,4 @@ LL | type Bar<T> = impl Sized;
1212

1313
error: aborting due to previous error
1414

15+
For more information about this error, try `rustc --explain E0792`.

tests/ui/type-alias-impl-trait/non-defining-method.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: non-defining opaque type use in defining scope
1+
error[E0792]: non-defining opaque type use in defining scope
22
--> $DIR/non-defining-method.rs:16:17
33
|
44
LL | fn foo() -> Self::Bar<u32> {}
@@ -12,3 +12,4 @@ LL | type Bar<T> = impl Sized;
1212

1313
error: aborting due to previous error
1414

15+
For more information about this error, try `rustc --explain E0792`.

0 commit comments

Comments
 (0)