提交 3e3dff71 编写于 作者: M Manish Goregaokar

Add test with attrs

上级 e0ae980f
......@@ -16,6 +16,16 @@ pub mod enums {
Quux(String),
}
/// Some docs
#[repr(C)]
#[non_exhaustive]
pub enum ExhaustiveWithAttrs {
Foo,
Bar,
Baz,
Quux(String),
}
// no warning, already non_exhaustive
#[non_exhaustive]
pub enum NonExhaustive {
......
......@@ -15,6 +15,15 @@ pub enum Exhaustive {
Quux(String),
}
/// Some docs
#[repr(C)]
pub enum ExhaustiveWithAttrs {
Foo,
Bar,
Baz,
Quux(String),
}
// no warning, already non_exhaustive
#[non_exhaustive]
pub enum NonExhaustive {
......
......@@ -20,8 +20,25 @@ LL | #[non_exhaustive]
LL | pub enum Exhaustive {
|
error: exported enums should not be exhaustive
--> $DIR/exhaustive_items.rs:20:5
|
LL | / pub enum ExhaustiveWithAttrs {
LL | | Foo,
LL | | Bar,
LL | | Baz,
LL | | Quux(String),
LL | | }
| |_____^
|
help: try adding #[non_exhaustive]
|
LL | #[non_exhaustive]
LL | pub enum ExhaustiveWithAttrs {
|
error: exported structs should not be exhaustive
--> $DIR/exhaustive_items.rs:46:5
--> $DIR/exhaustive_items.rs:55:5
|
LL | / pub struct Exhaustive {
LL | | foo: u8,
......@@ -40,5 +57,5 @@ LL | #[non_exhaustive]
LL | pub struct Exhaustive {
|
error: aborting due to 2 previous errors
error: aborting due to 3 previous errors
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册