Skip to content

error: cannot find derive macro BitfieldStruct in this scope #183

Closed
@ctaggart

Description

@ctaggart

I tried to manually fix it for about a half hour and wasn't able to, so I don't think it is trivial. (from ctaggart/openconnect-rust#5)

Camerons-MacBook-Pro:openconnect-rust cameron$ cargo build
   Compiling openconnect-rust v0.0.0 (/Users/cameron/github/openconnect-rust)
error: cannot find derive macro `BitfieldStruct` in this scope
    --> src/tun.rs:1198:29
     |
1198 |     #[derive ( Copy, Clone, BitfieldStruct )]
     |                             ^^^^^^^^^^^^^^

error: cannot find derive macro `BitfieldStruct` in this scope
    --> src/gpst.rs:1086:29
     |
1086 |     #[derive ( Copy, Clone, BitfieldStruct )]
     |                             ^^^^^^^^^^^^^^

It is complaining about:

https://github.com/ctaggart/openconnect-rust/blob/28ff0a3ca51386d841638c7fff9fe6a862e7465d/src/tun.rs#L1198-L1215

    #[derive ( Copy, Clone, BitfieldStruct )]
    #[repr(C)]
    #[src_loc = "81:1"]
    pub struct ip {
        #[bitfield(name = "ip_hl", ty = "u_int", bits = "0..=3")]
        #[bitfield(name = "ip_v", ty = "u_int", bits = "4..=7")]
        pub ip_hl_ip_v: [u8; 1],
        pub ip_tos: u_char,
        pub ip_len: u_short,
        pub ip_id: u_short,
        pub ip_off: u_short,
        pub ip_ttl: u_char,
        pub ip_p: u_char,
        pub ip_sum: u_short,
        pub ip_src: in_addr,
        pub ip_dst: in_addr,
        /* source and dest address */
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions