mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-15 22:54:00 +00:00
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:
commit
85fb463fc5
1 changed files with 20 additions and 0 deletions
|
@ -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() {}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue