mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
ItemTree: Lower tuple types despite invalid type
This commit is contained in:
parent
a50c64a4f1
commit
a4a8406c44
2 changed files with 29 additions and 7 deletions
|
@ -489,4 +489,27 @@ fn f() {
|
|||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enum_variant_type_macro() {
|
||||
check_diagnostics(
|
||||
r#"
|
||||
macro_rules! Type {
|
||||
() => { u32 };
|
||||
}
|
||||
enum Foo {
|
||||
Bar(Type![])
|
||||
}
|
||||
impl Foo {
|
||||
fn new() {
|
||||
Foo::Bar(0);
|
||||
Foo::Bar(0, 1);
|
||||
//^^^^^^^^^^^^^^ Expected 1 argument, found 2
|
||||
Foo::Bar();
|
||||
//^^^^^^^^^^ Expected 1 argument, found 0
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue