Auto merge of #16190 - Young-Flash:test_case_negative_impl, r=lnicola

add test case for negative impl

add a small test case to ensure that we don't emit `trait_impl_redundant_assoc_item` diagnostic for negative impl trait
This commit is contained in:
bors 2023-12-24 12:36:39 +00:00
commit 85fb463fc5

View file

@ -76,4 +76,24 @@ impl Marker for Foo {
"#,
)
}
#[test]
fn dont_work_for_negative_impl() {
check_diagnostics(
r#"
trait Marker {
const FLAG: bool = false;
fn boo();
fn foo () {}
}
struct Foo;
impl !Marker for Foo {
type T = i32;
const FLAG: bool = true;
fn bar() {}
fn boo() {}
}
"#,
)
}
}