Skip to content

Commit 3b68184

Browse files
committed
ir: Make Opaque types respect constness appropriately.
1 parent d4e4edb commit 3b68184

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ir/layout.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ impl Opaque {
8888
pub fn from_clang_ty(ty: &clang::Type) -> Type {
8989
let layout = Layout::new(ty.size(), ty.align());
9090
let ty_kind = TypeKind::Opaque;
91-
Type::new(None, Some(layout), ty_kind, false)
91+
let is_const = ty.is_const();
92+
Type::new(None, Some(layout), ty_kind, is_const)
9293
}
9394

9495
/// Return the known rust type we should use to create a correctly-aligned

0 commit comments

Comments
 (0)