rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Log item for which layout retrieval fails

Open mohe2015 opened this issue 1 year ago • 1 comments

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.

mohe2015 avatar Jul 25 '24 16:07 mohe2015

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);

aleb avatar Aug 13 '24 12:08 aleb