Skip to content

Commit f1beb28

Browse files
authored
Merge pull request #454 from KodrAus/fix/rustc-dep-of-std
Remove rustc internal crate feature
2 parents 2b786c9 + ef247c5 commit f1beb28

7 files changed

Lines changed: 726 additions & 741 deletions

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ exclude = ["/tests", "/.github"]
2121
serde = { version = "1.0.103", optional = true, default-features = false }
2222
arbitrary = { version = "1.0", optional = true }
2323
bytemuck = { version = "1.12", optional = true }
24-
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
25-
compiler_builtins = { version = "0.1.2", optional = true }
2624

2725
[dev-dependencies]
2826
trybuild = "1.0.18"
@@ -37,7 +35,6 @@ bytemuck = { version = "1.12.2", features = ["derive"] }
3735
[features]
3836
std = []
3937
example_generated = []
40-
rustc-dep-of-std = ["core", "compiler_builtins"]
4138

4239
[package.metadata.docs.rs]
4340
features = ["example_generated"]

tests/compile-fail/access_outside_visibility.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ error[E0603]: struct `Flags2` is private
77
note: the struct `Flags2` is defined here
88
--> tests/compile-fail/access_outside_visibility.rs:4:5
99
|
10-
4 | / bitflags! {
11-
5 | | pub struct Flags1: u32 {
12-
6 | | const FLAG_A = 0b00000001;
10+
4 | / bitflags! {
11+
5 | | pub struct Flags1: u32 {
12+
6 | | const FLAG_A = 0b00000001;
1313
... |
1414
12 | | }
1515
| |_____^

tests/compile-fail/bitflags_custom_bits.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ error[E0015]: cannot call non-const operator in constant functions
3434
note: impl defined here, but it is not `const`
3535
--> tests/compile-fail/bitflags_custom_bits.rs:42:1
3636
|
37-
42 | impl BitOr for MyInt {
37+
42 | impl BitOr for MyInt {
3838
| ^^^^^^^^^^^^^^^^^^^^
3939
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
4040
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -53,7 +53,7 @@ error[E0015]: cannot call non-const operator in constant functions
5353
note: impl defined here, but it is not `const`
5454
--> tests/compile-fail/bitflags_custom_bits.rs:26:23
5555
|
56-
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
56+
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
5757
| ^^^^^^^^^
5858
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
5959

@@ -71,7 +71,7 @@ error[E0015]: cannot call non-const operator in constant functions
7171
note: impl defined here, but it is not `const`
7272
--> tests/compile-fail/bitflags_custom_bits.rs:34:1
7373
|
74-
34 | impl BitAnd for MyInt {
74+
34 | impl BitAnd for MyInt {
7575
| ^^^^^^^^^^^^^^^^^^^^^
7676
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
7777
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -90,7 +90,7 @@ error[E0015]: cannot call non-const operator in constant functions
9090
note: impl defined here, but it is not `const`
9191
--> tests/compile-fail/bitflags_custom_bits.rs:26:23
9292
|
93-
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
93+
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
9494
| ^^^^^^^^^
9595
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
9696

@@ -108,7 +108,7 @@ error[E0015]: cannot call non-const operator in constant functions
108108
note: impl defined here, but it is not `const`
109109
--> tests/compile-fail/bitflags_custom_bits.rs:42:1
110110
|
111-
42 | impl BitOr for MyInt {
111+
42 | impl BitOr for MyInt {
112112
| ^^^^^^^^^^^^^^^^^^^^
113113
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
114114
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -127,7 +127,7 @@ error[E0015]: cannot call non-const operator in constant functions
127127
note: impl defined here, but it is not `const`
128128
--> tests/compile-fail/bitflags_custom_bits.rs:26:23
129129
|
130-
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
130+
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
131131
| ^^^^^^^^^
132132
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
133133

@@ -145,7 +145,7 @@ error[E0015]: cannot call non-const operator in constant functions
145145
note: impl defined here, but it is not `const`
146146
--> tests/compile-fail/bitflags_custom_bits.rs:34:1
147147
|
148-
34 | impl BitAnd for MyInt {
148+
34 | impl BitAnd for MyInt {
149149
| ^^^^^^^^^^^^^^^^^^^^^
150150
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
151151
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -164,7 +164,7 @@ error[E0015]: cannot call non-const operator in constant functions
164164
note: impl defined here, but it is not `const`
165165
--> tests/compile-fail/bitflags_custom_bits.rs:26:23
166166
|
167-
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
167+
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
168168
| ^^^^^^^^^
169169
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
170170

@@ -182,7 +182,7 @@ error[E0015]: cannot call non-const operator in constant functions
182182
note: impl defined here, but it is not `const`
183183
--> tests/compile-fail/bitflags_custom_bits.rs:34:1
184184
|
185-
34 | impl BitAnd for MyInt {
185+
34 | impl BitAnd for MyInt {
186186
| ^^^^^^^^^^^^^^^^^^^^^
187187
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
188188
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -201,7 +201,7 @@ error[E0015]: cannot call non-const operator in constant functions
201201
note: impl defined here, but it is not `const`
202202
--> tests/compile-fail/bitflags_custom_bits.rs:26:23
203203
|
204-
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
204+
26 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
205205
| ^^^^^^^^^
206206
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
207207

@@ -219,7 +219,7 @@ error[E0015]: cannot call non-const operator in constant functions
219219
note: impl defined here, but it is not `const`
220220
--> tests/compile-fail/bitflags_custom_bits.rs:34:1
221221
|
222-
34 | impl BitAnd for MyInt {
222+
34 | impl BitAnd for MyInt {
223223
| ^^^^^^^^^^^^^^^^^^^^^
224224
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
225225
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -238,7 +238,7 @@ error[E0015]: cannot call non-const operator in constant functions
238238
note: impl defined here, but it is not `const`
239239
--> tests/compile-fail/bitflags_custom_bits.rs:42:1
240240
|
241-
42 | impl BitOr for MyInt {
241+
42 | impl BitOr for MyInt {
242242
| ^^^^^^^^^^^^^^^^^^^^
243243
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
244244
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -257,7 +257,7 @@ error[E0015]: cannot call non-const operator in constant functions
257257
note: impl defined here, but it is not `const`
258258
--> tests/compile-fail/bitflags_custom_bits.rs:76:1
259259
|
260-
76 | impl Not for MyInt {
260+
76 | impl Not for MyInt {
261261
| ^^^^^^^^^^^^^^^^^^
262262
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
263263
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -276,7 +276,7 @@ error[E0015]: cannot call non-const operator in constant functions
276276
note: impl defined here, but it is not `const`
277277
--> tests/compile-fail/bitflags_custom_bits.rs:34:1
278278
|
279-
34 | impl BitAnd for MyInt {
279+
34 | impl BitAnd for MyInt {
280280
| ^^^^^^^^^^^^^^^^^^^^^
281281
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
282282
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -295,7 +295,7 @@ error[E0015]: cannot call non-const operator in constant functions
295295
note: impl defined here, but it is not `const`
296296
--> tests/compile-fail/bitflags_custom_bits.rs:50:1
297297
|
298-
50 | impl BitXor for MyInt {
298+
50 | impl BitXor for MyInt {
299299
| ^^^^^^^^^^^^^^^^^^^^^
300300
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
301301
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -314,7 +314,7 @@ error[E0015]: cannot call non-const operator in constant functions
314314
note: impl defined here, but it is not `const`
315315
--> tests/compile-fail/bitflags_custom_bits.rs:76:1
316316
|
317-
76 | impl Not for MyInt {
317+
76 | impl Not for MyInt {
318318
| ^^^^^^^^^^^^^^^^^^
319319
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
320320
= note: this error originates in the macro `$crate::__impl_public_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/compile-fail/bitflags_missing_type.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,3 @@ note: while trying to match `:`
99
|
1010
| $vis:vis struct $BitFlags:ident: $T:ty {
1111
| ^
12-
13-
error[E0601]: `main` function not found in crate `$CRATE`
14-
--> tests/compile-fail/bitflags_missing_type.rs:8:2
15-
|
16-
8 | }
17-
| ^ consider adding a `main` function to `$DIR/tests/compile-fail/bitflags_missing_type.rs`

tests/compile-fail/bitflags_missing_value.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,3 @@ note: while trying to match `=`
99
|
1010
| const $Flag:tt = $value:expr;
1111
| ^
12-
13-
error[E0601]: `main` function not found in crate `$CRATE`
14-
--> tests/compile-fail/bitflags_missing_value.rs:8:2
15-
|
16-
8 | }
17-
| ^ consider adding a `main` function to `$DIR/tests/compile-fail/bitflags_missing_value.rs`

0 commit comments

Comments
 (0)