Skip to content

Commit 36b0594

Browse files
authored
Merge pull request rust-lang#307 from GuillaumeGomez/const-attr
Add support for "ffi_const" function attribute
2 parents 6abd12a + 136548d commit 36b0594

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/attributes.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ pub fn from_fn_attrs<'gcc, 'tcx>(
124124
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_PURE) {
125125
func.add_attribute(FnAttribute::Pure);
126126
}
127+
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_CONST) {
128+
func.add_attribute(FnAttribute::Const);
129+
}
127130
}
128131

129132
let function_features =

0 commit comments

Comments
 (0)