add test case for negative impl

This commit is contained in:
Young-Flash 2023-12-24 20:07:33 +08:00
parent a24ede2066
commit cc73c00d81

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() {}
}
"#,
)
}
}