{"action":"created","issue":{"url":"https://api.github.com/repos/Wilfred/remacs/issues/915","repository_url":"https://api.github.com/repos/Wilfred/remacs","labels_url":"https://api.github.com/repos/Wilfred/remacs/issues/915/labels{/name}","comments_url":"https://api.github.com/repos/Wilfred/remacs/issues/915/comments","events_url":"https://api.github.com/repos/Wilfred/remacs/issues/915/events","html_url":"https://github.com/Wilfred/remacs/pull/915","id":369137364,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMTUwODI5","number":915,"title":"Also .rustified_enum some more recently introduced enums from gnutls","user":{"login":"jcreedcmu","id":1500822,"node_id":"MDQ6VXNlcjE1MDA4MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1500822?v=4","gravatar_id":"","url":"https://api.github.com/users/jcreedcmu","html_url":"https://github.com/jcreedcmu","followers_url":"https://api.github.com/users/jcreedcmu/followers","following_url":"https://api.github.com/users/jcreedcmu/following{/other_user}","gists_url":"https://api.github.com/users/jcreedcmu/gists{/gist_id}","starred_url":"https://api.github.com/users/jcreedcmu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcreedcmu/subscriptions","organizations_url":"https://api.github.com/users/jcreedcmu/orgs","repos_url":"https://api.github.com/users/jcreedcmu/repos","events_url":"https://api.github.com/users/jcreedcmu/events{/privacy}","received_events_url":"https://api.github.com/users/jcreedcmu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-11T14:03:23Z","updated_at":"2018-10-11T15:36:30Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/Wilfred/remacs/pulls/915","html_url":"https://github.com/Wilfred/remacs/pull/915","diff_url":"https://github.com/Wilfred/remacs/pull/915.diff","patch_url":"https://github.com/Wilfred/remacs/pull/915.patch"},"body":"Hello! I'm a long time emacs user, familiar with C (though not yet expert at rust or emacs internals), and thought remacs was a very interesting idea, and thought perhaps I'd try to take a crack at porting some builtins.\r\n\r\nWhile attempting to get it to build on my machine, I found I needed to add these `.rustified_enum` calls. Without them, the\r\n```rust\r\n                .default_enum_style(bindgen::EnumVariation::ModuleConsts)\r\n```\r\nin `build.rs` causes module wrappers for `gnutls_ctype_target_t` and `gnutls_fips_mode_t` and `gnutls_gost_paramset_t` to be created, e.g. the `bindgen`-generated `bindings.rs` contains\r\n```rust\r\npub mod gnutls_ctype_target_t {\r\n    pub type Type = u32;\r\n    pub const GNUTLS_CTYPE_CLIENT: Type = 0;\r\n    pub const GNUTLS_CTYPE_SERVER: Type = 1;\r\n    pub const GNUTLS_CTYPE_OURS: Type = 2;\r\n    pub const GNUTLS_CTYPE_PEERS: Type = 3;\r\n}\r\n```\r\nand, strangely, references to these enum types later in `bindings.rs` erroneously refer to simply (for example) `gnutls_ctype_target_t` as opposed to `gnutls_ctype_target_t::Type`. I don't know whether this is a bug in `bindgen` or an unintended consequence of how it's configured and called from `build.rs`. For example,\r\n```rust\r\nextern \"C\" {\r\n    pub fn gnutls_certificate_type_get2(\r\n        session: gnutls_session_t,\r\n        target: gnutls_ctype_target_t, // <- this should be gnutls_ctype_target_t::Type\r\n    ) -> gnutls_certificate_type_t;\r\n}\r\n```\r\nminus the comment I added, occurs in `bindings.rs`, and produces \r\n\r\n    error[E0573]: expected type, found module 'gnutls_ctype_target_t'"},"comment":{"url":"https://api.github.com/repos/Wilfred/remacs/issues/comments/429002793","html_url":"https://github.com/Wilfred/remacs/pull/915#issuecomment-429002793","issue_url":"https://api.github.com/repos/Wilfred/remacs/issues/915","id":429002793,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTAwMjc5Mw==","user":{"login":"jcreedcmu","id":1500822,"node_id":"MDQ6VXNlcjE1MDA4MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1500822?v=4","gravatar_id":"","url":"https://api.github.com/users/jcreedcmu","html_url":"https://github.com/jcreedcmu","followers_url":"https://api.github.com/users/jcreedcmu/followers","following_url":"https://api.github.com/users/jcreedcmu/following{/other_user}","gists_url":"https://api.github.com/users/jcreedcmu/gists{/gist_id}","starred_url":"https://api.github.com/users/jcreedcmu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcreedcmu/subscriptions","organizations_url":"https://api.github.com/users/jcreedcmu/orgs","repos_url":"https://api.github.com/users/jcreedcmu/repos","events_url":"https://api.github.com/users/jcreedcmu/events{/privacy}","received_events_url":"https://api.github.com/users/jcreedcmu/received_events","type":"User","site_admin":false},"created_at":"2018-10-11T15:36:30Z","updated_at":"2018-10-11T15:36:30Z","author_association":"NONE","body":"Oof, I don't know what the right resolution of this is, now, actually. Trying to bump the `bindgen` version all the way up to `b8cd8a161` (which in which @emilio just fixed rust-lang-nursery/rust-bindgen#1418) produces like 1200 other errors, so maybe some other version skew matters there...\r\n\r\nIn any event, this PR works for me as a temporary workaround to get remacs building. Feel free to merge or close depending on whether you think it's useful or a gross hack..."}}
{"actor":{"display_login":"jcreedcmu"}}