You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template <classT>
classTemplatizedBitfield {
T t : 6;
};
Bindgen Invocation
$ bindgen input.hpp
Actual Results
thread 'main' panicked at 'Bitfield without layout? Gah!', /checkout/src/libcore/option.rs:839:4
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:69
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:58
at /checkout/src/libstd/panicking.rs:381
3: std::panicking::default_hook
at /checkout/src/libstd/panicking.rs:397
4: std::panicking::rust_panic_with_hook
at /checkout/src/libstd/panicking.rs:577
5: std::panicking::begin_panic
at /checkout/src/libstd/panicking.rs:538
6: std::panicking::begin_panic_fmt
at /checkout/src/libstd/panicking.rs:522
7: rust_begin_unwind
at /checkout/src/libstd/panicking.rs:498
8: core::panicking::panic_fmt
at /checkout/src/libcore/panicking.rs:71
9: core::option::expect_failed
at /checkout/src/libcore/option.rs:839
10: <core::option::Option<T>>::expect
at /checkout/src/libcore/option.rs:302
11: bindgen::ir::comp::bitfields_to_allocation_units
at ./src/ir/comp.rs:573
12: bindgen::ir::comp::raw_fields_to_fields_and_bitfield_units
at ./src/ir/comp.rs:501
13: bindgen::ir::comp::CompFields::compute_bitfield_units
at ./src/ir/comp.rs:698
14: bindgen::ir::comp::CompInfo::compute_bitfield_units
at ./src/ir/comp.rs:1476
15: bindgen::ir::context::BindgenContext::compute_bitfield_units::{{closure}}
at ./src/ir/context.rs:996
16: bindgen::ir::context::BindgenContext::with_loaned_item
at ./src/ir/context.rs:979
17: bindgen::ir::context::BindgenContext::compute_bitfield_units
at ./src/ir/context.rs:995
18: bindgen::ir::context::BindgenContext::gen
at ./src/ir/context.rs:1170
19: bindgen::codegen::codegen
at ./src/codegen/mod.rs:3358
20: bindgen::Bindings::generate
at ./src/lib.rs:1635
21: bindgen::Builder::generate
at ./src/lib.rs:1097
22: bindgen::main::{{closure}}
at ./src/main.rs:55
23: std::panicking::try::do_call
at /checkout/src/libstd/panicking.rs:480
24: __rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:99
25: std::panicking::try
at /checkout/src/libstd/panicking.rs:459
26: std::panic::catch_unwind
at /checkout/src/libstd/panic.rs:361
27: bindgen::main
at ./src/main.rs:54
28: __rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:99
29: std::rt::lang_start
at /checkout/src/libstd/panicking.rs:459
at /checkout/src/libstd/panic.rs:361
at /checkout/src/libstd/rt.rs:59
30: main
31: __libc_start_main
32: _start
Expected Results
No panic. Perhaps the templatized struct is opaque, or we don't emit bitfield accessors for it.
The text was updated successfully, but these errors were encountered:
Instead of panicking when we see a bitfield that does not have a layout, return
an error up the stack. If we get an error when allocating bitfields into units,
then make the whole struct opaque.
Fixesrust-lang#1140
Instead of panicking when we see a bitfield that does not have a layout, return
an error up the stack. If we get an error when allocating bitfields into units,
then make the whole struct opaque.
Fixesrust-lang#1140
Make bitfield unit allocation fallible
Instead of panicking when we see a bitfield that does not have a layout, return an error up the stack. If we get an error when allocating bitfields into units, then make the whole struct opaque.
Fixes#1140
r? @pepyakin or @emilio
Make bitfield unit allocation fallible
Instead of panicking when we see a bitfield that does not have a layout, return an error up the stack. If we get an error when allocating bitfields into units, then make the whole struct opaque.
Fixes#1140
r? @pepyakin or @emilio
Input C/C++ Header
Bindgen Invocation
Actual Results
Expected Results
No panic. Perhaps the templatized struct is opaque, or we don't emit bitfield accessors for it.
The text was updated successfully, but these errors were encountered: