rust-bindgen
rust-bindgen copied to clipboard
Log item for which layout retrieval fails
Related https://github.com/rust-lang/rust-bindgen/issues/1768, https://github.com/ghpr-asia/wsdf/issues/18
I think this would at least make analyzing this failure easier and based on the wsdf issue it seems that in some cases including another file also helps fixing this.
Using unwrap_or_else leaves the impression that a value might be returned, but the block always panics. How about the change made in the https://github.com/ghpr-asia/wsdf/issues/18 issue you linked:
let Some(layout) = layout else { panic... };
BTW, if anybody else is interested, the item is already logged at the very start of the method and the debug log can be enabled by setting the env var: RUST_LOG=debug
debug!("<CompInfo as CodeGenerator>::codegen: item = {:?}", item);