Skip to content

Commit 85fb463

Browse files
committed
Auto merge of rust-lang#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
2 parents a24ede2 + cc73c00 commit 85fb463

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs

+20
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,24 @@ impl Marker for Foo {
7676
"#,
7777
)
7878
}
79+
80+
#[test]
81+
fn dont_work_for_negative_impl() {
82+
check_diagnostics(
83+
r#"
84+
trait Marker {
85+
const FLAG: bool = false;
86+
fn boo();
87+
fn foo () {}
88+
}
89+
struct Foo;
90+
impl !Marker for Foo {
91+
type T = i32;
92+
const FLAG: bool = true;
93+
fn bar() {}
94+
fn boo() {}
95+
}
96+
"#,
97+
)
98+
}
7999
}

0 commit comments

Comments
 (0)