-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: cannot find derive macro BitfieldStruct
in this scope
#183
Comments
I think your |
Yes, I tried that yesterday. I tried that again and noticed it is actually a different error: error: cannot determine resolution for the derive macro `BitfieldStruct`
--> src/tun.rs:1199:29
|
1199 | #[derive ( Copy, Clone, BitfieldStruct )]
| ^^^^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot find derive macro `BitfieldStruct` in this scope
--> src/gpst.rs:1086:29
|
1086 | #[derive ( Copy, Clone, BitfieldStruct )]
| |
I did manage to figure out a way to get it to work, using the old macro import approach: In your #[macro_use]
extern crate c2rust_bitfields; This will make the derive macro a globally visible type, so you can use it in the rest of the crate without any use imports. That said, this shouldn't be necessary - so I'm inclined to think that this is a rust macro resolution bug in the 2018e macro imports. |
This was my mistake, I removed the |
The import should work, but you'll need to import it again in the |
@ctaggart Any luck with my workaround? |
I've opened up a rustc issue here: rust-lang/rust#65935 |
Thanks for opening the rustc issue. I haven't tried it. I was working on work and waiting for #184 as well. There are two solutions proposed in this issue. I can try them both this week. |
Since rustc is deprecating custom attributes and WONTFIX the issue above, we should revert back to using |
Do we need to revert back though? If custom attrs are going away, then this bug shouldn't appear? By that, I mean that the issue is due to the attr, which is going away/to be replaced by another approach |
I guess we should do that if we want a more immediate fix, though |
It's going to take a lot longer to work around the attributes thing. For now we'll keep using the custom attribute and just need to fix the imports. |
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)
It is complaining about:
https://github.com/ctaggart/openconnect-rust/blob/28ff0a3ca51386d841638c7fff9fe6a862e7465d/src/tun.rs#L1198-L1215
The text was updated successfully, but these errors were encountered: