Flags after adding A and C: FlagWrapper(FLAG_A | FLAG_C)
Flags after removing A: FlagWrapper(FLAG_C)
Has FLAG_C? true
Has FLAG_A? false
Flags as bytes: [4]
warning: fields buffer and indices are never read
--> src\graphics\internal_canvas.rs:689:9
|
688 | pub struct InstanceArrayView {
| ----------------- fields in this struct
689 | pub buffer: ArcBuffer,
| ^^^^^^
690 | pub indices: ArcBuffer,
| ^^^^^^^
|
= note: InstanceArrayView has a derived impl for the trait Debug, but this is intentionally ignored
during dead code analysis
= note: #[warn(dead_code)] on by default
warning: method append is never used
--> src\vfs.rs:112:8
|
97 | pub trait VFS: Debug {
| --- method in this trait
...
112 | fn append(&self, path: &Path) -> GameResult<Box> {
| ^^^^^^
warning: method len is never used
--> src\vfs.rs:149:8
|
140 | pub trait VMetadata {
| --------- method in this trait
...
149 | fn len(&self) -> u64;
| ^^^
warning: ggez (lib) generated 3 warnings
Compiling ggez v0.9.3 (C:\Users\fer52\ggez-master)
error[E0204]: the trait std::marker::Copy cannot be implemented for this type
--> examples\01_super_simple_1.rs:15:10
|
15 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Zeroable, Pod)]
| ^^^^
16 | struct FlagWrapper(Flags);
| ----- this field does not implement std::marker::Copy
|
= note: this error originates in the derive macro Copy (in Nightly builds, run with -Z macro-backtrace
for more info)
error[E0277]: the trait bound Flags: Clone is not satisfied
--> examples\01_super_simple_1.rs:16:20
|
15 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Zeroable, Pod)]
| ----- in this derive macro expansion
16 | struct FlagWrapper(Flags);
| ^^^^^ the trait Clone is not implemented for Flags
|
note: required by a bound in AssertParamIsClone
--> C:\Users\fer52.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\clone.rs:198:34
|
198 | pub struct AssertParamIsClone<T: Clone + ?Sized> {
| ^^^^^ required by this bound in AssertParamIsClone
= note: this error originates in the derive macro Clone (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(Clone)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9 |
17 + #[derive(Clone)]
18 | PublicBitFlags(<crate::__private::PublicFlags>::Internal);
|
warning: fields buffer and indices are never read
--> src\graphics\internal_canvas.rs:689:9
|
688 | pub struct InstanceArrayView {
| ----------------- fields in this struct
689 | pub buffer: ArcBuffer,
| ^^^^^^
690 | pub indices: ArcBuffer,
| ^^^^^^^
|
= note: InstanceArrayView has a derived impl for the trait Debug, but this is intentionally ignored
during dead code analysis
= note: #[warn(dead_code)] on by default
warning: method append is never used
--> src\vfs.rs:112:8
|
97 | pub trait VFS: Debug {
| --- method in this trait
...
112 | fn append(&self, path: &Path) -> GameResult<Box> {
| ^^^^^^
warning: method len is never used
--> src\vfs.rs:149:8
|
140 | pub trait VMetadata {
| --------- method in this trait
...
149 | fn len(&self) -> u64;
| ^^^
warning: ggez (lib) generated 3 warnings
Compiling ggez v0.9.3 (C:\Users\fer52\ggez-master)
error[E0277]: Flags doesn't implement Debug
--> examples\01_super_simple_1.rs:53:38
|
53 | println!("Flags now have: {:?}", flags.flags);
| ^^^^^^^^^^^ Flags cannot be formatted using {:?}
|
= help: the trait Debug is not implemented for Flags
= note: add #[derive(Debug)] to Flags or manually impl Debug for Flags
= note: this error originates in the macro $crate::format_args_nl which comes from the expansion of the macro println (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(Debug)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9
|
17 + #[derive(Debug)]
18 | visstrPublicBitFlags(<crate::__private::PublicFlags>::Internal);
|
warning: fields buffer and indices are never read
--> src\graphics\internal_canvas.rs:689:9
|
688 | pub struct InstanceArrayView {
| ----------------- fields in this struct
689 | pub buffer: ArcBuffer,
| ^^^^^^
690 | pub indices: ArcBuffer,
| ^^^^^^^
|
= note: InstanceArrayView has a derived impl for the trait Debug, but this is intentionally ignored
during dead code analysis
= note: #[warn(dead_code)] on by default
warning: method append is never used
--> src\vfs.rs:112:8
|
97 | pub trait VFS: Debug {
| --- method in this trait
...
112 | fn append(&self, path: &Path) -> GameResult<Box> {
| ^^^^^^
warning: method len is never used
--> src\vfs.rs:149:8
|
140 | pub trait VMetadata {
| --------- method in this trait
...
149 | fn len(&self) -> u64;
| ^^^
warning: ggez (lib) generated 3 warnings
Compiling ggez v0.9.3 (C:\Users\fer52\ggez-master)
error[E0774]: derive may only be applied to structs, enums and unions
--> examples\01_super_simple_1.rs:4:1
|
4 | #[derive(Debug)]
| ^^^^^^^^^^^^^^^^ not applicable here
5 | / bitflags! {
6 | | struct Flags: u8 {
7 | | const FLAG_A = 0b0000_0001;
8 | | const FLAG_B = 0b0000_0010;
... |
11 | | }
12 | | }
| |_- not a struct, enum or union
error[E0277]: Flags doesn't implement Debug
--> examples\01_super_simple_1.rs:51:38
|
51 | println!("Flags now have: {:?}", flags.flags);
| ^^^^^^^^^^^ Flags cannot be formatted using {:?}
|
= help: the trait Debug is not implemented for Flags
= note: add #[derive(Debug)] to Flags or manually impl Debug for Flags
= note: this error originates in the macro $crate::format_args_nl which comes from the expansion of the macro println (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(Debug)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9
|
17 + #[derive(Debug)]
18 | PublicBitFlags(<crate::__private::PublicFlags>::Internal);
|
Flags set: Flags(FLAG_A | FLAG_C)
Has FLAG_B? false
Flags after removing FLAG_A: Flags(FLAG_C)
Has FLAG_A? false
All flags set: Flags(FLAG_A | FLAG_B | FLAG_C | FLAG_D)
簡單說明
bitflags! 宏用於定義一組旗標常數,每個常數是一個唯一的位元。
Flags::empty() 產生一個沒有任何旗標被設置的 Flags 實例。
insert 用來設定一個或多個旗標。
remove 用來清除一個或多個旗標。
contains 用來檢查一個旗標是否被設定。
Flags::all() 回傳所有旗標都打開的狀態。
需要在 Cargo.toml 裡加 bitflags:
toml
[dependencies]
bitflags = "1.3"
這是 bitflags 最基礎的用法,簡潔好上手。如需更複雜用法可以再告訴我!
User
warning: fields buffer and indices are never read
--> src\graphics\internal_canvas.rs:689:9
|
688 | pub struct InstanceArrayView {
| ----------------- fields in this struct
689 | pub buffer: ArcBuffer,
| ^^^^^^
690 | pub indices: ArcBuffer,
| ^^^^^^^
|
= note: InstanceArrayView has a derived impl for the trait Debug, but this is intentionally ignored
during dead code analysis
= note: #[warn(dead_code)] on by default
warning: method append is never used
--> src\vfs.rs:112:8
|
97 | pub trait VFS: Debug {
| --- method in this trait
...
112 | fn append(&self, path: &Path) -> GameResult<Box> {
| ^^^^^^
warning: method len is never used
--> src\vfs.rs:149:8
|
140 | pub trait VMetadata {
| --------- method in this trait
...
149 | fn len(&self) -> u64;
| ^^^
warning: ggez (lib) generated 3 warnings
Compiling ggez v0.9.3 (C:\Users\fer52\ggez-master)
error[E0428]: the name main is defined multiple times
--> examples\01_super_simple_1.rs:36:1
|
12 | fn main() {
| --------- previous definition of the value main here
...
36 | fn main(){
| ^^^^^^^^^ main redefined here
|
= note: main must be defined only once in the value namespace of this module
error[E0255]: the name Flags is defined multiple times
--> examples\01_super_simple_1.rs:4:1
|
1 | use bitflags::{bitflags, Flags};
| ----- previous import of the trait Flags here
...
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^ Flags redefined here
|
= note: Flags must be defined only once in the type namespace of this module
= note: this error originates in the macro $crate::__declare_public_bitflags which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can use as to change the binding name of the import
|
1 | use bitflags::{bitflags, Flags as OtherFlags};
| +++++++++++++
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_public_bitflags_consts which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
移除 use bitflags::Flags;,只保留 use bitflags::bitflags;
確認專案沒重複定義多個 main 函式
確認 bitflags! 宏裡面定義的名稱沒和 import 的 trait 名稱衝突
如果還有問題,歡迎貼你的完整 main.rs 或範例碼,我幫你看更精確的問題。
Not yet included in a published release.
visstruct
PublicBitFlagsas
error[E0277]: Flags doesn't implement Debug
--> examples\01_super_simple_1.rs:16:20
|
15 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Zeroable, Pod)]
| ----- in this derive macro expansion
16 | struct FlagWrapper(Flags);
| ^^^^^ Flags cannot be formatted using {:?}
|
= help: the trait Debug is not implemented for Flags
= note: add #[derive(Debug)] to Flags or manually impl Debug for Flags
= note: this error originates in the derive macro Debug (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(Debug)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9
|
17 + #[derive(Debug)]
18 | visstructPublicBitFlags(<PublicBitFlagsascrate::__private::PublicFlags>::Internal);
|
error[E0369]: binary operation == cannot be applied to type Flags
--> examples\01_super_simple_1.rs:16:20
|
15 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Zeroable, Pod)]
| --------- in this derive macro expansion
16 | struct FlagWrapper(Flags);
| ^^^^^
|
note: an implementation of PartialEq might be missing for Flags
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^ must implement PartialEq
= note: this error originates in the derive macro PartialEq which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(PartialEq)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9
|
17 + #[derive(PartialEq)]
18 | visstructPublicBitFlags(<PublicBitFlagsascrate::__private::PublicFlags>::Internal);
|
error[E0277]: the trait bound Flags: std::cmp::Eq is not satisfied
--> examples\01_super_simple_1.rs:16:20
|
15 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Zeroable, Pod)]
| -- in this derive macro expansion
16 | struct FlagWrapper(Flags);
| ^^^^^ the trait std::cmp::Eq is not implemented for Flags
|
note: required by a bound in AssertParamIsEq
--> C:\Users\fer52.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\cmp.rs:363:31
|
363 | pub struct AssertParamIsEq<T: Eq + ?Sized> {
| ^^ required by this bound in AssertParamIsEq
= note: this error originates in the derive macro Eq (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(Eq)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9 |
17 + #[derive(Eq)]
18 | visstructPublicBitFlags(<PublicBitFlagsascrate::__private::PublicFlags>::Internal);
|
error[E0277]: the trait bound Flags: Zeroable is not satisfied
--> examples\01_super_simple_1.rs:16:20
|
16 | struct FlagWrapper(Flags);
| ^^^^^ the trait Zeroable is not implemented for Flags
|
= help: the following other types implement trait Zeroable:
()
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
(A, B, C, D, E, F, G, H)
and 80 others
note: required by a bound in _::{closure#0}::check::assert_impl
--> examples\01_super_simple_1.rs:15:45
|
15 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Zeroable, Pod)]
| ^^^^^^^^ required by this bound in assert_impl
= note: this error originates in the derive macro Zeroable (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound Flags: Pod is not satisfied
--> examples\01_super_simple_1.rs:16:20
|
16 | struct FlagWrapper(Flags);
| ^^^^^ the trait Pod is not implemented for Flags
|
= help: the following other types implement trait Pod:
()
FlagWrapper
ManuallyDrop
Option
PhantomData
PhantomPinned
Wrapping
[T; 0]
and 61 others
note: required by a bound in _::{closure#0}::check::assert_impl
--> examples\01_super_simple_1.rs:15:55
|
15 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Zeroable, Pod)]
| ^^^ required by this bound in assert_impl
= note: this error originates in the derive macro Pod (in Nightly builds, run with -Z macro-backtrace for more info)
Some errors have detailed explanations: E0204, E0277, E0369.
For more information about an error, try rustc --explain E0204.
error[E0277]: Flags doesn't implement Debug
--> examples\01_super_simple_1.rs:58:43
|
58 | println!("Flags after removal: {:?}", flags.flags);
| ^^^^^^^^^^^ Flags cannot be formatted using {:?}
|
= help: the trait Debug is not implemented for Flags
= note: add #[derive(Debug)] to Flags or manually impl Debug for Flags
= note: this error originates in the macro $crate::format_args_nl which comes from the expansion of the macro println (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(Debug)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9
|
17 + #[derive(Debug)]
18 | visstructPublicBitFlags(<PublicBitFlagsascrate::__private::PublicFlags>::Internal);
|
error[E0515]: cannot return value referencing local variable bits
--> examples\01_super_simple_1.rs:42:9
|
42 | bytes_of(&bits)
| ^^^^^^^^^-----^
| | |
| | bits is borrowed here
| returns a value referencing data owned by the current function
Some errors have detailed explanations: E0277, E0515.
For more information about an error, try rustc --explain E0277.
error[E0277]: Flags doesn't implement Debug
--> examples\01_super_simple_1.rs:55:43
|
55 | println!("Flags after removal: {:?}", flags.flags);
| ^^^^^^^^^^^ Flags cannot be formatted using {:?}
|
= help: the trait Debug is not implemented for Flags
= note: add #[derive(Debug)] to Flags or manually impl Debug for Flags
= note: this error originates in the macro $crate::format_args_nl which comes from the expansion of the macro println (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating Flags with #[derive(Debug)]
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:17:9
|
17 + #[derive(Debug)]
18 | visstructPublicBitFlags(<PublicBitFlagsascrate::__private::PublicFlags>::Internal);
|
Some errors have detailed explanations: E0277, E0774.
For more information about an error, try rustc --explain E0277.
error[E0277]: the trait bound Flags: bitflags::Flags is not satisfied
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| | ^
| | |
| |_the trait bitflags::Flags is not implemented for Flags
| required by a bound introduced by this call
|
note: required by a bound in to_writer
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\parser.rs:42:21 |
42 | pub fn to_writer<B: Flags>(flags: &B, mut writer: impl Write) -> Result<(), fmt::Error>
| ^^^^^ required by this bound in to_writer
= note: this error originates in the macro $crate::__impl_internal_bitflags which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= 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)
error: the Self constructor can only be used with tuple or unit structs
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_public_bitflags_forward which comes from the
expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:17:18
|
17 | flags.insert(Flags::FLAG_A | Flags::FLAG_C);
| ^^^^^
|
help: you can add the dyn keyword if you want a trait object
|
17 | flags.insert(::FLAG_A | Flags::FLAG_C);
| ++++ +
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:17:34
|
17 | flags.insert(Flags::FLAG_A | Flags::FLAG_C);
| ^^^^^
|
help: you can add the dyn keyword if you want a trait object
|
17 | flags.insert(Flags::FLAG_A | ::FLAG_C);
| ++++ +
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:21:47
|
21 | println!("Has FLAG_B? {}", flags.contains(Flags::FLAG_B));
| ^^^^^
|
help: you can add the dyn keyword if you want a trait object
|
21 | println!("Has FLAG_B? {}", flags.contains(::FLAG_B));
| ++++ +
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:24:18
|
24 | flags.remove(Flags::FLAG_A);
| ^^^^^
|
help: you can add the dyn keyword if you want a trait object
|
24 | flags.remove(::FLAG_A);
| ++++ +
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:28:47
|
28 | println!("Has FLAG_A? {}", flags.contains(Flags::FLAG_A));
| ^^^^^
|
help: you can add the dyn keyword if you want a trait object
|
28 | println!("Has FLAG_A? {}", flags.contains(::FLAG_A));
| ++++ +
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:38:18
|
38 | flags.insert(Flags::FLAGS_A |Flags::FLAGS_C);
| ^^^^^
|
help: you can add the dyn keyword if you want a trait object
|
38 | flags.insert(::FLAGS_A |Flags::FLAGS_C);
| ++++ +
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:38:34
|
38 | flags.insert(Flags::FLAGS_A |Flags::FLAGS_C);
| ^^^^^
|
help: you can add the dyn keyword if you want a trait object
|
38 | flags.insert(Flags::FLAGS_A |::FLAGS_C);
| ++++ +
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__declare_public_bitflags which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_public_bitflags_consts which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have intended to implement this trait for a given type
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:516:29
|
516| impl $PublicBitFlags for /* Type */ {
| ++++++++++++++
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_internal_bitflags which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_public_bitflags_ops which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_public_bitflags_iter which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_bitflags which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have intended to implement this trait for a given type
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\lib.rs:624:29
|
624| impl $PublicBitFlags for /* Type */ {
| ++++++++++++++
error[E0782]: expected a type, found a trait
--> examples\01_super_simple_1.rs:4:1
|
4 | / bitflags! {
5 | | struct Flags: u8 {
6 | | const FLAG_A = 0b0000_0001;
7 | | const FLAG_B = 0b0000_0010;
... |
10 | | }
11 | | }
| |_^
|
= note: this error originates in the macro $crate::__impl_public_bitflags_iter which comes from the expansion of the macro bitflags (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have intended to implement this trait for a given type
--> C:\Users\fer52.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.8.0\src\public.rs:283:23
|
283| impl $BitFlags for /* Type */ {
| ++++++++++++++
Some errors have detailed explanations: E0255, E0277, E0428, E0782.
For more information about an error, try rustc --explain E0255.