summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-08-04 17:34:28 -0500
committerGitHub <noreply@github.com>2017-08-04 17:34:28 -0500
commit39a88d366cde89c04a78e01f0147b94ff1e3eb6a (patch)
tree016800421600e538f2529496c55c64e09c2eea21 /src/codegen/mod.rs
parentde180c42e52d6b9236a11ba887a6896b4ffae819 (diff)
parentf4763bc8d4754ee4f89b2ab29b45d4c18e14d647 (diff)
Auto merge of #891 - fitzgen:fix-test-expectations, r=photoszzt
Fix test expectations r? @photoszzt cc @tmfink: I had to revert the target features commit because there were a bunch of compilation failures in the test expectations (we had another, earlier regression that accidentally made it so that we weren't compiling and running the test expectations in CI, so we didn't catch the target features PR's regressions).
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index ef6f031f..5c00a53d 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -350,7 +350,7 @@ impl CodeGenerator for Module {
}
if item.id() == ctx.root_module() {
- if result.saw_union && !ctx.options().rust_features().untagged_union() {
+ if result.saw_union && !ctx.options().unstable_rust {
utils::prepend_union_types(ctx, &mut *result);
}
if result.saw_incomplete_array {
@@ -911,8 +911,8 @@ impl<'a> FieldCodegen<'a> for FieldData {
let field_ty = ctx.resolve_type(self.ty());
let ty = self.ty().to_rust_ty_or_opaque(ctx, &());
- // NB: If supported, we use proper `union` types.
- let ty = if parent.is_union() && !ctx.options().rust_features().untagged_union() {
+ // NB: In unstable rust we use proper `union` types.
+ let ty = if parent.is_union() && !ctx.options().unstable_rust {
if ctx.options().enable_cxx_namespaces {
quote_ty!(ctx.ext_cx(), root::__BindgenUnionField<$ty>)
} else {
@@ -1052,8 +1052,8 @@ impl BitfieldUnit {
-> P<ast::Item> {
let ctor_name = self.ctor_name(ctx);
- // If supported, add the const.
- let fn_prefix = if ctx.options().rust_features().const_fn() {
+ // If we're generating unstable Rust, add the const.
+ let fn_prefix = if ctx.options().unstable_rust {
quote_tokens!(ctx.ext_cx(), pub const fn)
} else {
quote_tokens!(ctx.ext_cx(), pub fn)
@@ -1115,8 +1115,8 @@ impl Bitfield {
let offset = self.offset_into_unit();
let mask = self.mask();
- // If supported, add the const.
- let fn_prefix = if ctx.options().rust_features().const_fn() {
+ // If we're generating unstable Rust, add the const.
+ let fn_prefix = if ctx.options().unstable_rust {
quote_tokens!(ctx.ext_cx(), pub const fn)
} else {
quote_tokens!(ctx.ext_cx(), pub fn)
@@ -1445,7 +1445,7 @@ impl CodeGenerator for CompInfo {
}
let canonical_name = item.canonical_name(ctx);
- let builder = if is_union && ctx.options().rust_features().untagged_union() {
+ let builder = if is_union && ctx.options().unstable_rust {
aster::AstBuilder::new()
.item()
.pub_()
@@ -1552,7 +1552,7 @@ impl CodeGenerator for CompInfo {
());
}
- if is_union && !ctx.options().rust_features().untagged_union() {
+ if is_union && !ctx.options().unstable_rust {
let layout = layout.expect("Unable to get layout information?");
let ty = BlobTyBuilder::new(layout).build();
let field = StructFieldBuilder::named("bindgen_union_field")