Skip to content

Commit 2dda8ad

Browse files
committed
Use E0741 for structural match error
1 parent 7f13a4a commit 2dda8ad

6 files changed

+10
-10
lines changed

src/librustc_resolve/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ E0671: r##"
18841884
18851885
Const parameters cannot depend on type parameters.
18861886
The following is therefore invalid:
1887-
```compile_fail,E0740
1887+
```compile_fail,E0741
18881888
#![feature(const_generics)]
18891889
18901890
fn const_id<T, const N: T>() -> T { // error

src/librustc_typeck/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ pub fn checked_type_of(tcx: TyCtxt<'_>, def_id: DefId, fail: bool) -> Option<Ty<
15361536
struct_span_err!(
15371537
tcx.sess,
15381538
hir_ty.span,
1539-
E0740,
1539+
E0741,
15401540
"the types of const generic parameters must derive `PartialEq` and `Eq`",
15411541
).span_label(
15421542
hir_ty.span,

src/librustc_typeck/error_codes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4978,11 +4978,11 @@ the future, [RFC 2091] prohibits their implementation without a follow-up RFC.
49784978
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
49794979
"##,
49804980

4981-
E0740: r##"
4981+
E0741: r##"
49824982
Only `structural_match` types (that is, types that derive `PartialEq` and `Eq`)
49834983
may be used as the types of const generic parameters.
49844984
4985-
```compile_fail,E0740
4985+
```compile_fail,E0741
49864986
#![feature(const_generics)]
49874987
49884988
struct A;

src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ LL | struct B<T, const N: T>(PhantomData<[T; N]>);
77
= note: for more information, see https://github.com/rust-lang/rust/issues/44580
88
= help: add `#![feature(const_generics)]` to the crate attributes to enable
99

10-
error[E0740]: the types of const generic parameters must derive `PartialEq` and `Eq`
10+
error[E0741]: the types of const generic parameters must derive `PartialEq` and `Eq`
1111
--> $DIR/const-param-type-depends-on-type-param-ungated.rs:3:22
1212
|
1313
LL | struct B<T, const N: T>(PhantomData<[T; N]>);
1414
| ^ `T` doesn't derive both `PartialEq` and `Eq`
1515

1616
error: aborting due to 2 previous errors
1717

18-
Some errors have detailed explanations: E0658, E0740.
18+
Some errors have detailed explanations: E0658, E0741.
1919
For more information about an error, try `rustc --explain E0658`.

src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ LL | #![feature(const_generics)]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88

9-
error[E0740]: the types of const generic parameters must derive `PartialEq` and `Eq`
9+
error[E0741]: the types of const generic parameters must derive `PartialEq` and `Eq`
1010
--> $DIR/const-param-type-depends-on-type-param.rs:9:34
1111
|
1212
LL | pub struct Dependent<T, const X: T>([(); X]);
1313
| ^ `T` doesn't derive both `PartialEq` and `Eq`
1414

1515
error: aborting due to previous error
1616

17-
For more information about this error, try `rustc --explain E0740`.
17+
For more information about this error, try `rustc --explain E0741`.

src/test/ui/const-generics/forbid-non-structural_match-types.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ LL | #![feature(const_generics)]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88

9-
error[E0740]: the types of const generic parameters must derive `PartialEq` and `Eq`
9+
error[E0741]: the types of const generic parameters must derive `PartialEq` and `Eq`
1010
--> $DIR/forbid-non-structural_match-types.rs:11:19
1111
|
1212
LL | struct D<const X: C>;
1313
| ^ `C` doesn't derive both `PartialEq` and `Eq`
1414

1515
error: aborting due to previous error
1616

17-
For more information about this error, try `rustc --explain E0740`.
17+
For more information about this error, try `rustc --explain E0741`.

0 commit comments

Comments
 (0)