summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-08-04 14:58:16 -0700
committerNick Fitzgerald <fitzgen@gmail.com>2017-08-04 14:58:16 -0700
commit65a68cd75f40db2cd8346dbdd334cbc1737fc68c (patch)
treef6efa28618ea94b9821025c4f9c02702bdfc9355 /src/codegen/mod.rs
parentde180c42e52d6b9236a11ba887a6896b4ffae819 (diff)
Revert "Add --rust-target to replace --unstable-rust"
This reverts commit 0bb7b9f1c4652f63f41eba4064b79c044fd3d955. It turns out our CI stopped running test expectations in an earlier regression (from d73507e; fix incoming) and so this pull request actually introduced a bunch of failures when compiling the test expectations and running their unit tests :(
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")