Skip to content

Commit

Permalink
Auto merge of #16190 - Young-Flash:test_case_negative_impl, r=lnicola
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Dec 24, 2023
2 parents a24ede2 + cc73c00 commit 85fb463
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
}
"#,
)
}
}

0 comments on commit 85fb463

Please sign in to comment.