enumflags2
enumflags2 copied to clipboard
Fix `unused_qualifications` warning on nightly
Happens when using glob import use enumflags2::*
See https://github.com/rust-lang/rust/issues/122519 and https://github.com/rust-lang/rust/pull/122435
Hello?
Ah, sorry, somehow this got entirely lost in my inbox.
Haha, no worries. I'm not sure why the tests are failing but if you could point me towards the right direction I wouldn't mind fixing them
These errors tell me about as much as they're probably telling you.
The trybuild
tests check that the compiler output is what we expect, so they are a bit fragile – changes in how particular errors get formatted will cause failures when the new nightly is pulled in. So, I'd start this by checking whether the tests pass on master
with the current nightly compiler. However, there seems to (also?) be some other issue at hand here, since the tests aren't finding the enumflags2
crate now?
If you get stuck I'll look into this eventually, but it's not the first thing on my mind...
Output from cargo +nightly test --all
(nightly ver 1.80) on branch master
It seems like no crates exist
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.09s
Running tests/requires_std.rs (target/debug/deps/bitflags_requires_std-334306a05ac2907c)
running 15 tests
test assign_ops ... ok
test debug_format ... ok
test debug_format_alternate ... ok
test debug_generic ... ok
test display_format ... ok
test fn_derive ... ok
test format ... ok
test inferred_values ... ok
test iterator ... ok
test module ... ok
test test_ctors ... ok
test test_exactly_one ... ok
test test_len ... ok
test test_mutation ... ok
test test_ops ... ok
test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/bitflag_tests.rs (target/debug/deps/bitflags_test-d57d2d540137ea38)
running 10 tests
test assign_ops ... ok
test fn_derive ... ok
test inferred_values ... ok
test iterator ... ok
test module ... ok
test test_ctors ... ok
test test_exactly_one ... ok
test test_len ... ok
test test_mutation ... ok
test test_ops ... ok
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/bitflag_tests_2018.rs (target/debug/deps/bitflags_test_2018-460be7373a5f0724)
running 10 tests
test everything::assign_ops ... ok
test everything::fn_derive ... ok
test everything::inferred_values ... ok
test everything::iterator ... ok
test everything::module ... ok
test everything::test_ctors ... ok
test everything::test_exactly_one ... ok
test everything::test_len ... ok
test everything::test_mutation ... ok
test everything::test_ops ... ok
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/no_implicit_prelude.rs (target/debug/deps/bitflags_test_no_implicit_prelude-8c544abcd2c3fd43)
running 1 test
test test_foo ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/no_implicit_prelude_2018.rs (target/debug/deps/bitflags_test_no_implicit_prelude_2018-84c431af08768dab)
running 1 test
test test_foo ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/no_std.rs (target/debug/deps/bitflags_test_no_std-f6caf40e00b9ec0a)
running 10 tests
test assign_ops ... ok
test fn_derive ... ok
test inferred_values ... ok
test iterator ... ok
test module ... ok
test test_ctors ... ok
test test_exactly_one ... ok
test test_len ... ok
test test_mutation ... ok
test test_ops ... ok
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/no_std_2018.rs (target/debug/deps/bitflags_test_no_std_2018-5f7bb5cfa8d0b273)
running 10 tests
test everything::assign_ops ... ok
test everything::fn_derive ... ok
test everything::inferred_values ... ok
test everything::iterator ... ok
test everything::module ... ok
test everything::test_ctors ... ok
test everything::test_exactly_one ... ok
test everything::test_len ... ok
test everything::test_mutation ... ok
test everything::test_ops ... ok
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/not_literal.rs (target/debug/deps/not_literal-69ac2f80263f1c64)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/serde.rs (target/debug/deps/serde-b12de9c3fa30c74a)
running 1 test
test serde_compile ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running ui_tests.rs (target/debug/deps/ui_tests-1af09f01bc8a6702)
running 1 test
Locking 1 package to latest compatible version
Adding bitflags-test-suite-tests v0.0.0 (/data/home/i/Downloads/enumflags2/target/tests/trybuild/bitflags-test-suite)
Checking bitflags-test-suite-tests v0.0.0 (/data/home/i/Downloads/enumflags2/target/tests/trybuild/bitflags-test-suite)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
test [0m[1mui/invalid_attribute_syntax.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror: expected `|`
[0m[34m --> $DIR/invalid_attribute_syntax.rs:3:24
[0m[34m |
[0m[34m3 | #[bitflags(default = A + B)]
[0m[34m | ^
[0m[34m
[0m[34merror: unexpected end of input, expected identifier
[0m[34m --> $DIR/invalid_attribute_syntax.rs:9:1
[0m[34m |
[0m[34m9 | #[bitflags(default = A |)]
[0m[34m | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[0m[34m |
[0m[34m = note: this error originates in the attribute macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
[0m[34m
[0m[34merror: unexpected end of input, expected identifier
[0m[34m --> $DIR/invalid_attribute_syntax.rs:15:1
[0m[34m |
[0m[34m15 | #[bitflags(default =)]
[0m[34m | ^^^^^^^^^^^^^^^^^^^^^^
[0m[34m |
[0m[34m = note: this error originates in the attribute macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
[0m[34m
[0m[34merror: expected `=`
[0m[34m --> $DIR/invalid_attribute_syntax.rs:21:1
[0m[34m |
[0m[34m21 | #[bitflags(default)]
[0m[34m | ^^^^^^^^^^^^^^^^^^^^
[0m[34m |
[0m[34m = note: this error originates in the attribute macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
[0m[34m
[0m[34merror: expected `default`
[0m[34m --> $DIR/invalid_attribute_syntax.rs:27:12
[0m[34m |
[0m[34m27 | #[bitflags(yes)]
[0m[34m | ^^^
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0428]: the name `Test` is defined multiple times
[0m[31m --> ui/invalid_attribute_syntax.rs:28:1
[0m[31m |
[0m[31m22 | enum Test {
[0m[31m | --------- previous definition of the type `Test` here
[0m[31m...
[0m[31m28 | enum Test {
[0m[31m | ^^^^^^^^^ `Test` redefined here
[0m[31m |
[0m[31m = note: `Test` must be defined only once in the type namespace of this module
[0m[31m
[0m[31merror[E0432]: unresolved import `enumflags2`
[0m[31m --> ui/invalid_attribute_syntax.rs:1:5
[0m[31m |
[0m[31m1 | use enumflags2::bitflags;
[0m[31m | ^^^^^^^^^^ maybe a missing crate `enumflags2`?
[0m[31m |
[0m[31m = help: consider adding `extern crate enumflags2` to use the `enumflags2` crate
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/invalid_name_in_default.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror[E0599]: no variant or associated item named `C` found for enum `Test` in the current scope
[0m[34m --> ui/invalid_name_in_default.rs:3:26
[0m[34m |
[0m[34m3 | #[bitflags(default = A | C)]
[0m[34m | ^
[0m[34m | |
[0m[34m | variant or associated item not found in `Test`
[0m[34m | help: there is a variant with a similar name: `A`
[0m[34m...
[0m[34m6 | enum Test {
[0m[34m | --------- variant or associated item `C` not found for this enum
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0432]: unresolved import `enumflags2`
[0m[31m --> ui/invalid_name_in_default.rs:1:5
[0m[31m |
[0m[31m1 | use enumflags2::bitflags;
[0m[31m | ^^^^^^^^^^ maybe a missing crate `enumflags2`?
[0m[31m |
[0m[31m = help: consider adding `extern crate enumflags2` to use the `enumflags2` crate
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/invalid_repr.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror: repr must be an integer type for #[bitflags].
[0m[34m --> $DIR/invalid_repr.rs:2:8
[0m[34m |
[0m[34m2 | #[repr(C)]
[0m[34m | ^
[0m[34m
[0m[34merror: Signed types in a repr are not supported.
[0m[34m --> $DIR/invalid_repr.rs:10:8
[0m[34m |
[0m[34m10 | #[repr(i32)]
[0m[34m | ^^^
[0m[34m
[0m[34merror: #[repr(usize)] is not supported. Use u32 or u64 instead.
[0m[34m --> $DIR/invalid_repr.rs:18:8
[0m[34m |
[0m[34m18 | #[repr(usize)]
[0m[34m | ^^^^^
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/invalid_repr.rs:2:8
[0m[31m |
[0m[31m2 | #[repr(C)]
[0m[31m | ^ maybe a missing crate `core`?
[0m[31m
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/invalid_repr.rs:10:8
[0m[31m |
[0m[31m10 | #[repr(i32)]
[0m[31m | ^^^ maybe a missing crate `core`?
[0m[31m
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/invalid_repr.rs:18:8
[0m[31m |
[0m[31m18 | #[repr(usize)]
[0m[31m | ^^^^^ maybe a missing crate `core`?
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/literal_out_of_range.rs[0m ... [0m[32mok
[0mtest [0m[1mui/multiple_bits.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror: Flags must have exactly one set bit
[0m[34m --> $DIR/multiple_bits.rs:6:5
[0m[34m |
[0m[34m6 | MultipleBits = 6,
[0m[34m | ^^^^^^^^^^^^^^^^
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/multiple_bits.rs:6:5
[0m[31m |
[0m[31m6 | MultipleBits = 6,
[0m[31m | ^^^^^^^^^^^^^^^^ maybe a missing crate `core`?
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/multiple_bits_deferred.rs[0m ... [0m[32mok
[0mtest [0m[1mui/not_enum.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror: #[bitflags] requires an enum
[0m[34m --> $DIR/not_enum.rs:2:1
[0m[34m |
[0m[34m2 | / #[derive(Copy, Clone)]
[0m[34m3 | | struct Foo(u16);
[0m[34m | |________________^
[0m[34m
[0m[34merror: #[bitflags] requires an enum
[0m[34m --> $DIR/not_enum.rs:6:1
[0m[34m |
[0m[34m6 | const WTF: u8 = 42;
[0m[34m | ^^^^^^^^^^^^^^^^^^^
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/not_enum.rs:2:1
[0m[31m |
[0m[31m2 | #[derive(Copy, Clone)]
[0m[31m | ^ maybe a missing crate `core`?
[0m[31m
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/not_enum.rs:6:1
[0m[31m |
[0m[31m6 | const WTF: u8 = 42;
[0m[31m | ^^^^^ maybe a missing crate `core`?
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/overlapping_flags.rs[0m ... [0m[32mok
[0mtest [0m[1mui/shift_out_of_range.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror: Flag value out of range for u64
[0m[34m --> $DIR/shift_out_of_range.rs:5:5
[0m[34m |
[0m[34m5 | BigNumber = 1 << 69,
[0m[34m | ^^^^^^^^^^^^^^^^^^^
[0m[34m
[0m[34merror: Flag value out of range for u16
[0m[34m --> $DIR/shift_out_of_range.rs:12:5
[0m[34m |
[0m[34m12 | BigNumber = 1 << 20,
[0m[34m | ^^^^^^^^^^^^^^^^^^^
[0m[34m
[0m[34merror: Flag value out of range for u16
[0m[34m --> $DIR/shift_out_of_range.rs:19:5
[0m[34m |
[0m[34m19 | BigNumber = (1 << 10) << 10,
[0m[34m | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[0m[34m
[0m[34merror[E0080]: evaluation of constant value failed
[0m[34m --> $DIR/shift_out_of_range.rs:5:17
[0m[34m |
[0m[34m5 | BigNumber = 1 << 69,
[0m[34m | ^^^^^^^ attempt to shift left by `69_i32`, which would overflow
[0m[34m
[0m[34merror[E0080]: evaluation of constant value failed
[0m[34m --> $DIR/shift_out_of_range.rs:12:17
[0m[34m |
[0m[34m12 | BigNumber = 1 << 20,
[0m[34m | ^^^^^^^ attempt to shift left by `20_i32`, which would overflow
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/shift_out_of_range.rs:5:5
[0m[31m |
[0m[31m5 | BigNumber = 1 << 69,
[0m[31m | ^^^^^^^^^^^^^^^^^^^ maybe a missing crate `core`?
[0m[31m
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/shift_out_of_range.rs:12:5
[0m[31m |
[0m[31m12 | BigNumber = 1 << 20,
[0m[31m | ^^^^^^^^^^^^^^^^^^^ maybe a missing crate `core`?
[0m[31m
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/shift_out_of_range.rs:19:5
[0m[31m |
[0m[31m19 | BigNumber = (1 << 10) << 10,
[0m[31m | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ maybe a missing crate `core`?
[0m[31m
[0m[31merror[E0080]: evaluation of constant value failed
[0m[31m --> ui/shift_out_of_range.rs:5:17
[0m[31m |
[0m[31m5 | BigNumber = 1 << 69,
[0m[31m | ^^^^^^^ attempt to shift left by `69_i32`, which would overflow
[0m[31m
[0m[31merror[E0080]: evaluation of constant value failed
[0m[31m --> ui/shift_out_of_range.rs:12:17
[0m[31m |
[0m[31m12 | BigNumber = 1 << 20,
[0m[31m | ^^^^^^^ attempt to shift left by `20_i32`, which would overflow
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/sneaky_make_bitflags.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror[E0308]: mismatched types
[0m[34m --> ui/sneaky_make_bitflags.rs:16:13
[0m[34m |
[0m[34m16 | let x = make_bitflags!(Test::{C});
[0m[34m | ^^^^^^^^^^^^^^^^^^^^^^^^^
[0m[34m | |
[0m[34m | expected `Test`, found `u8`
[0m[34m | expected due to this
[0m[34m |
[0m[34m = note: this error originates in the macro `make_bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0432]: unresolved import `enumflags2`
[0m[31m --> ui/sneaky_make_bitflags.rs:1:5
[0m[31m |
[0m[31m1 | use enumflags2::{bitflags, make_bitflags};
[0m[31m | ^^^^^^^^^^ maybe a missing crate `enumflags2`?
[0m[31m |
[0m[31m = help: consider adding `extern crate enumflags2` to use the `enumflags2` crate
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/with_fields.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror: Bitflag variants cannot contain additional data
[0m[34m --> $DIR/with_fields.rs:5:8
[0m[34m |
[0m[34m5 | Bar(u32),
[0m[34m | ^^^^^
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/with_fields.rs:5:8
[0m[31m |
[0m[31m5 | Bar(u32),
[0m[31m | ^^^^^ maybe a missing crate `core`?
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/zero_disciminant.rs[0m ... [0m[1m[31mmismatch
[0m
[0m[1m[34mEXPECTED:
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[34merror: Flags must have exactly one set bit
[0m[34m --> $DIR/zero_disciminant.rs:5:5
[0m[34m |
[0m[34m5 | Zero = 0,
[0m[34m | ^^^^^^^^
[0m[34m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m
[0m[1m[31mACTUAL OUTPUT:
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0m[31merror[E0433]: failed to resolve: maybe a missing crate `core`?
[0m[31m --> ui/zero_disciminant.rs:5:5
[0m[31m |
[0m[31m5 | Zero = 0,
[0m[31m | ^^^^^^^^ maybe a missing crate `core`?
[0m[31m┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
[0mnote: If the [0m[31mactual output[0m is the correct output you can bless it by rerunning
your test with the environment variable TRYBUILD=overwrite
test [0m[1mui/zero_discriminant_deferred.rs[0m ... [0m[32mok
[0m
test ui ... FAILED
failures:
---- ui stdout ----
thread 'ui' panicked at /data/home/i/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trybuild-1.0.95/src/run.rs:101:13:
9 of 13 tests failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
ui
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.26s
error: test failed, to rerun pass `-p bitflags-test-suite --test ui-tests`
It seems like adding extern crate core
and extern crate enumflags2
does the trick
Okay, why is this? Did the Rust edition used by trybuild change at some point? If so, why?
I'm not sure, I tried googling for "trybuild crate not found" and came up with nothing. Stable 1.76.0 - Fail Stable 1.78.0 - Fail Nightly 1.80.0 - Fail Nightly 1.79.0 (2024-03-31) - Fail (the last successful version) Downgrade trybuild to 1.0.91 - Fail (the last successful version) Maybe you can send me your Cargo.lock or something?
Would prefer it if this could get merged soon so I can stop getting these, heheh
Thanks for the PR. I finally found the time to properly dedicate some attention to this. The failing tests were because of dtolnay/trybuild#274, for which I've pushed a workaround now. I've also manually merged the first commit of your PR.
Great, thanks :)