mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
Add completes_associated_const test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
parent
37d0c722ef
commit
a9aae250ed
1 changed files with 22 additions and 0 deletions
|
@ -444,3 +444,25 @@ fn foo() {
|
|||
expect![[r#""#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_associated_const() {
|
||||
check_empty(
|
||||
r#"
|
||||
#[derive(PartialEq, Eq)]
|
||||
struct Ty(u8);
|
||||
|
||||
impl Ty {
|
||||
const ABC: Self = Self(0);
|
||||
}
|
||||
|
||||
fn f(t: Ty) {
|
||||
match t {
|
||||
Ty::$0 => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
"#,
|
||||
expect![[""]],
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue