Skip to content

Commit 6a4b157

Browse files
committed
Remove erroneous E0133 code from an error message.
This error message is about `derive` and `packed`, but E0133 is for "Unsafe code was used outside of an unsafe function or block".
1 parent bdf520f commit 6a4b157

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Diff for: compiler/rustc_mir_transform/src/check_packed_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn unsafe_derive_on_repr_packed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
4242
"that does not derive `Copy`"
4343
};
4444
let message = format!(
45-
"`{}` can't be derived on this `#[repr(packed)]` struct {} (error E0133)",
45+
"`{}` can't be derived on this `#[repr(packed)]` struct {}",
4646
tcx.item_name(tcx.trait_id_of_impl(def_id.to_def_id()).expect("derived trait name")),
4747
extra
4848
);

Diff for: src/test/ui/derives/deriving-with-repr-packed.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `Clone` can't be derived on this `#[repr(packed)]` struct with type or const parameters (error E0133)
1+
error: `Clone` can't be derived on this `#[repr(packed)]` struct with type or const parameters
22
--> $DIR/deriving-with-repr-packed.rs:11:16
33
|
44
LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
@@ -13,7 +13,7 @@ LL | #![deny(unaligned_references)]
1313
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
1414
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
1515

16-
error: `PartialEq` can't be derived on this `#[repr(packed)]` struct with type or const parameters (error E0133)
16+
error: `PartialEq` can't be derived on this `#[repr(packed)]` struct with type or const parameters
1717
--> $DIR/deriving-with-repr-packed.rs:11:32
1818
|
1919
LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
@@ -23,7 +23,7 @@ LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
2323
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
2424
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
2525

26-
error: `Hash` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy` (error E0133)
26+
error: `Hash` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy`
2727
--> $DIR/deriving-with-repr-packed.rs:19:19
2828
|
2929
LL | #[derive(Default, Hash)]
@@ -33,7 +33,7 @@ LL | #[derive(Default, Hash)]
3333
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
3434
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
3535

36-
error: `Debug` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy` (error E0133)
36+
error: `Debug` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy`
3737
--> $DIR/deriving-with-repr-packed.rs:39:10
3838
|
3939
LL | #[derive(Debug, Default)]
@@ -46,7 +46,7 @@ LL | #[derive(Debug, Default)]
4646
error: aborting due to 4 previous errors
4747

4848
Future incompatibility report: Future breakage diagnostic:
49-
error: `Clone` can't be derived on this `#[repr(packed)]` struct with type or const parameters (error E0133)
49+
error: `Clone` can't be derived on this `#[repr(packed)]` struct with type or const parameters
5050
--> $DIR/deriving-with-repr-packed.rs:11:16
5151
|
5252
LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
@@ -62,7 +62,7 @@ LL | #![deny(unaligned_references)]
6262
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
6363

6464
Future breakage diagnostic:
65-
error: `PartialEq` can't be derived on this `#[repr(packed)]` struct with type or const parameters (error E0133)
65+
error: `PartialEq` can't be derived on this `#[repr(packed)]` struct with type or const parameters
6666
--> $DIR/deriving-with-repr-packed.rs:11:32
6767
|
6868
LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
@@ -78,7 +78,7 @@ LL | #![deny(unaligned_references)]
7878
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
7979

8080
Future breakage diagnostic:
81-
error: `Hash` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy` (error E0133)
81+
error: `Hash` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy`
8282
--> $DIR/deriving-with-repr-packed.rs:19:19
8383
|
8484
LL | #[derive(Default, Hash)]
@@ -94,7 +94,7 @@ LL | #![deny(unaligned_references)]
9494
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
9595

9696
Future breakage diagnostic:
97-
error: `Debug` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy` (error E0133)
97+
error: `Debug` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy`
9898
--> $DIR/deriving-with-repr-packed.rs:39:10
9999
|
100100
LL | #[derive(Debug, Default)]

0 commit comments

Comments
 (0)