diff --git a/zerocopy-derive/src/lib.rs b/zerocopy-derive/src/lib.rs index 8e1b9801998..8793665cb14 100644 --- a/zerocopy-derive/src/lib.rs +++ b/zerocopy-derive/src/lib.rs @@ -12,7 +12,7 @@ // our MSRV. #![allow(unknown_lints)] #![deny(renamed_and_removed_lints)] -#![deny(clippy::all, clippy::missing_safety_doc)] +#![deny(clippy::all, clippy::missing_safety_doc, clippy::undocumented_unsafe_blocks)] #![deny( rustdoc::bare_urls, rustdoc::broken_intra_doc_links, diff --git a/zerocopy-derive/src/repr.rs b/zerocopy-derive/src/repr.rs index 5bd4a8a9115..d475d1e96ff 100644 --- a/zerocopy-derive/src/repr.rs +++ b/zerocopy-derive/src/repr.rs @@ -73,9 +73,8 @@ impl Config { } let initial_sp = metas[0].span(); - let err_span = metas.iter().skip(1).fold(Some(initial_sp), |sp_option, meta| { - sp_option.and_then(|sp| sp.join(meta.span())) - }); + let err_span = metas.iter().skip(1).try_fold(initial_sp, |sp, meta| sp.join(meta.span())); + if self.allowed_combinations.contains(&reprs.as_slice()) { Ok(reprs)