Add non_exhaustive checks in derive_partial_eq_without_eq.rs ui test

This commit is contained in:
Guillaume Gomez 2024-01-15 23:27:47 +01:00
parent a1989046c1
commit 136a582349
2 changed files with 64 additions and 0 deletions

View File

@ -121,4 +121,36 @@ pub fn _from_mod() -> _hidden::InPubFn {
#[derive(PartialEq)]
struct InternalTy;
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
#[non_exhaustive]
pub struct MissingEqNonExhaustive {
foo: u32,
bar: String,
}
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
pub struct MissingEqNonExhaustive1 {
foo: u32,
#[non_exhaustive]
bar: String,
}
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
#[non_exhaustive]
pub enum MissingEqNonExhaustive2 {
Foo,
Bar,
}
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
pub enum MissingEqNonExhaustive3 {
Foo,
#[non_exhaustive]
Bar,
}
fn main() {}

View File

@ -121,4 +121,36 @@ pub fn _from_mod() -> _hidden::InPubFn {
#[derive(PartialEq)]
struct InternalTy;
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
#[non_exhaustive]
pub struct MissingEqNonExhaustive {
foo: u32,
bar: String,
}
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
pub struct MissingEqNonExhaustive1 {
foo: u32,
#[non_exhaustive]
bar: String,
}
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
#[non_exhaustive]
pub enum MissingEqNonExhaustive2 {
Foo,
Bar,
}
// This is a `non_exhaustive` type so should not warn.
#[derive(Debug, PartialEq)]
pub enum MissingEqNonExhaustive3 {
Foo,
#[non_exhaustive]
Bar,
}
fn main() {}