Skip to content

Commit 9a2fce6

Browse files
authored
[derive] Don't emit #[cfg(coverage_nightly)] (#2123) (#2126)
As of nightly-2024-11-20 - specifically [1] - this triggers an `unexpected_cfgs` lint even when emitted in derive-generated code. [1] rust-lang/rust#132577 Fixes #2117 gherrit-pr-id: I9d536f0ea08475afe0b65411b225aa55f4db449a
1 parent 775a1ba commit 9a2fce6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

zerocopy-derive/tests/issue_2117.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2024 The Fuchsia Authors
2+
//
3+
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
4+
// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
5+
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
6+
// This file may not be copied, modified, or distributed except according to
7+
// those terms.
8+
9+
// See comment in `include.rs` for why we disable the prelude.
10+
#![no_implicit_prelude]
11+
#![allow(warnings)]
12+
#![forbid(unexpected_cfgs)]
13+
14+
include!("include.rs");
15+
16+
// Make sure no unexpected `cfg`s are emitted by our derives (see #2117).
17+
18+
#[derive(imp::KnownLayout)]
19+
#[repr(C)]
20+
pub struct Test(pub [u8; 32]);

0 commit comments

Comments
 (0)