Skip to content
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

Ignore annotation not work #572

Closed
FourLeafTec opened this issue Sep 19, 2020 · 3 comments
Closed

Ignore annotation not work #572

FourLeafTec opened this issue Sep 19, 2020 · 3 comments

Comments

@FourLeafTec
Copy link

FourLeafTec commented Sep 19, 2020

I have a project like following:

-src
  |-server
      |-mod.rs
      |-server.rs
      |-defines.rs
  |-lib.rs

defines.rs

use websocket::OwnedMessage;

pub type SinkContent = websocket::client::r#async::Framed<
    tokio::net::TcpStream,
    websocket::r#async::MessageCodec<OwnedMessage>,
>;
pub type SplitSink = futures::stream::SplitSink<SinkContent>;

when scan defines.rs will error:

thread 'main' panicked at 'SplitSink is not generic', /Users/flt/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/cbindgen-0.9.1/src/bindgen/ir/typedef.rs:158:9

So, i try to ignore this mod
then i add ignore annotation to mod.rs:

pub mod server;

/// cbindgen:ignore
pub mod defines;

but the ignore not work, cbindgen also error:

thread 'main' panicked at 'SplitSink is not generic', /Users/flt/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/cbindgen-0.9.1/src/bindgen/ir/typedef.rs:158:9
@emilio
Copy link
Collaborator

emilio commented Sep 21, 2020

Can you attach a more reduced test-case maybe? The underlying bug seems similar to #573.

Does adding /// cbindgen:ignore to pub type SplitSink help? Also, maybe there's other similar typedefs that you're hitting instead?

Thanks

@FourLeafTec
Copy link
Author

FourLeafTec commented Sep 26, 2020

No help for add /// cbindgen:ignore to pub type SplitSink

I create a test case at FourLeafTec/cbg_test_572

@emilio
Copy link
Collaborator

emilio commented Oct 13, 2020

That test-case is using cbindgen 0.9, which hadn't implemented the annotation. If I change the Cargo.toml to use 0.15 for example (latest release) it works just fine.

@emilio emilio closed this as completed Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants