fix(napi-derive): prevent constructor redundant in debug mode

This commit is contained in:
LongYinan 2021-10-31 13:12:14 +08:00
parent 270b6bda38
commit 88c4175c2d
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -244,7 +244,7 @@ pub fn check_recorded_struct_for_impl(ident: &Ident, opts: &BindgenAttrs) -> Bin
let mut map = state.parsed.borrow_mut(); let mut map = state.parsed.borrow_mut();
if let Some(parsed) = map.get_mut(&struct_name) { if let Some(parsed) = map.get_mut(&struct_name) {
if opts.constructor().is_some() { if opts.constructor().is_some() && !cfg!(debug_assertions) {
if parsed.ctor_defined { if parsed.ctor_defined {
bail_span!( bail_span!(
ident, ident,