mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Collect trait impls inside unnamed consts
This commit is contained in:
parent
f04f38d3d7
commit
7c1c0e6fea
3 changed files with 61 additions and 19 deletions
|
@ -1292,3 +1292,25 @@ mod b {
|
|||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn impl_in_unnamed_const() {
|
||||
check_types(
|
||||
r#"
|
||||
struct S;
|
||||
|
||||
trait Tr {
|
||||
fn method(&self) -> u16;
|
||||
}
|
||||
|
||||
const _: () = {
|
||||
impl Tr for S {}
|
||||
};
|
||||
|
||||
fn f() {
|
||||
S.method();
|
||||
//^^^^^^^^^^ u16
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue