Skip to content

Commit

Permalink
fix: setting attributes on dynamic_functions seems bad, so let's not …
Browse files Browse the repository at this point in the history
…do it
  • Loading branch information
oberrich committed Feb 6, 2025
1 parent 973cca1 commit f2aecce
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions bindgen/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4798,15 +4798,18 @@ impl CodeGenerator for Function {
}

let mut attrs = attrs_for_item(item, ctx);
set_must_use(
&mut attrs,
signature
.return_type()
.into_resolver()
.through_type_refs()
.resolve(ctx)
.must_use(ctx),
);

if !is_dynamic_function {
set_must_use(
&mut attrs,
signature
.return_type()
.into_resolver()
.through_type_refs()
.resolve(ctx)
.must_use(ctx),
);
}

let abi = match signature.abi(ctx, Some(name)) {
Err(err) => {
Expand Down

0 comments on commit f2aecce

Please sign in to comment.