Skip to content

Commit

Permalink
Merge pull request rust-lang#307 from GuillaumeGomez/const-attr
Browse files Browse the repository at this point in the history
Add support for "ffi_const" function attribute
  • Loading branch information
antoyo authored Jul 22, 2023
2 parents 6abd12a + 136548d commit 36b0594
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ pub fn from_fn_attrs<'gcc, 'tcx>(
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_PURE) {
func.add_attribute(FnAttribute::Pure);
}
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_CONST) {
func.add_attribute(FnAttribute::Const);
}
}

let function_features =
Expand Down

0 comments on commit 36b0594

Please sign in to comment.