__attribute__((noreturn)) in function pointer argument applies to function's type #2715
Closed
Description
opened on Jan 11, 2024
Input C/C++ Header
void foo(__attribute__((noreturn)) void (*arg)(void));
Bindgen Invocation
$ bindgen /tmp/foo.h
Actual Results
/* automatically generated by rust-bindgen 0.66.1 */
extern "C" {
pub fn foo(arg: ::std::option::Option<unsafe extern "C" fn() -> !>) -> !;
}
Expected Results
/* automatically generated by rust-bindgen 0.66.1 */
extern "C" {
pub fn foo(arg: ::std::option::Option<unsafe extern "C" fn() -> !>);
}
Note the lack of the second -> !
.
Notes
I'm fairly sure the problem is here:
rust-bindgen/bindgen/ir/function.rs
Lines 508 to 511 in d0c2b1e
Since the type of argument of the function contains __attribute__((noreturn))
, this assumes that the function does as well...
Metadata
Assignees
Labels
No labels
Activity