diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-05-14 19:08:01 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-05-14 19:08:50 +0200 |
commit | 3b6818431ca88ee286984a9ddad6c86c7e807126 (patch) | |
tree | 038b9c9a10f54429e0d18c88536afeb0ab3ba35b | |
parent | d4e4edbbceb348c543ee3fc8a0eb627fc7f5f9be (diff) |
ir: Make Opaque types respect constness appropriately.
-rw-r--r-- | src/ir/layout.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir/layout.rs b/src/ir/layout.rs index bc3f8a5a..cca33cc3 100644 --- a/src/ir/layout.rs +++ b/src/ir/layout.rs @@ -88,7 +88,8 @@ impl Opaque { pub fn from_clang_ty(ty: &clang::Type) -> Type { let layout = Layout::new(ty.size(), ty.align()); let ty_kind = TypeKind::Opaque; - Type::new(None, Some(layout), ty_kind, false) + let is_const = ty.is_const(); + Type::new(None, Some(layout), ty_kind, is_const) } /// Return the known rust type we should use to create a correctly-aligned |