summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-07-24 11:11:17 +0200
committerGitHub <noreply@github.com>2019-07-24 11:11:17 +0200
commita3d8cf75f85fda70d36f2c74d2ecd0b414a63736 (patch)
tree94ce484c0686352ce6de7935797c0998ecb8beb8 /src/codegen/mod.rs
parent9fe3e909bea3cc24759148f27d03772a479c6ecf (diff)
Cleanup wchar_t layout computation to happen later. (#1596)
This is a breaking cheange since WChar is exposed, but should be no behavior change otherwise.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 15ace9e9..e026a3c7 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -3060,8 +3060,9 @@ impl TryToRustTy for Type {
IntKind::ULong => Ok(raw_type(ctx, "c_ulong")),
IntKind::LongLong => Ok(raw_type(ctx, "c_longlong")),
IntKind::ULongLong => Ok(raw_type(ctx, "c_ulonglong")),
- IntKind::WChar { size } => {
- let ty = Layout::known_type_for_size(ctx, size)
+ IntKind::WChar => {
+ let layout = self.layout(ctx).expect("Couldn't compute wchar_t's layout?");
+ let ty = Layout::known_type_for_size(ctx, layout.size)
.expect("Non-representable wchar_t?");
let ident = ctx.rust_ident_raw(ty);
Ok(quote! { #ident })