Skip to content

Commit 2e95e2f

Browse files
committed
fix interior_mutable_const err
1 parent 04d4ae7 commit 2e95e2f

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

tests/ui/declare_interior_mutable_const.stderr

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,25 @@ error: a `const` item should never be interior mutable
4545
--> $DIR/declare_interior_mutable_const.rs:44:5
4646
|
4747
LL | const INPUT: T;
48-
| ^^^^^^^^^^^^^^^
48+
| ^^^^^^^^^^^^^-^
49+
| |
50+
| consider requiring `T` to be `Copy`
4951

5052
error: a `const` item should never be interior mutable
5153
--> $DIR/declare_interior_mutable_const.rs:47:5
5254
|
5355
LL | const ASSOC: Self::NonCopyType;
54-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
| ^^^^^^^^^^^^^-----------------^
57+
| |
58+
| consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
5559

5660
error: a `const` item should never be interior mutable
5761
--> $DIR/declare_interior_mutable_const.rs:51:5
5862
|
5963
LL | const AN_INPUT: T = Self::INPUT;
60-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64+
| ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^
65+
| |
66+
| consider requiring `T` to be `Copy`
6167

6268
error: a `const` item should never be interior mutable
6369
--> $DIR/declare_interior_mutable_const.rs:16:9
@@ -74,7 +80,9 @@ error: a `const` item should never be interior mutable
7480
--> $DIR/declare_interior_mutable_const.rs:60:5
7581
|
7682
LL | const SELF_2: Self;
77-
| ^^^^^^^^^^^^^^^^^^^
83+
| ^^^^^^^^^^^^^^----^
84+
| |
85+
| consider requiring `Self` to be `Copy`
7886

7987
error: a `const` item should never be interior mutable
8088
--> $DIR/declare_interior_mutable_const.rs:81:5
@@ -86,13 +94,17 @@ error: a `const` item should never be interior mutable
8694
--> $DIR/declare_interior_mutable_const.rs:84:5
8795
|
8896
LL | const U_SELF: U = U::SELF_2;
89-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97+
| ^^^^^^^^^^^^^^-^^^^^^^^^^^^^
98+
| |
99+
| consider requiring `U` to be `Copy`
90100

91101
error: a `const` item should never be interior mutable
92102
--> $DIR/declare_interior_mutable_const.rs:87:5
93103
|
94104
LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
95-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105+
| ^^^^^^^^^^^^^^^--------------^^^^^^^^^^^^
106+
| |
107+
| consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
96108

97109
error: aborting due to 13 previous errors
98110

0 commit comments

Comments
 (0)