aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-14 19:09:36 +0100
committerGitHub <[email protected]>2020-07-14 19:09:36 +0100
commit3f2ab436f45a4fae32514756736055819ead2baa (patch)
tree2af71e48e9d3fce856e6cd70d754d03345b1d66d /crates/ra_hir_ty
parenta50c64a4f13b47de7fa08eb3e6ff222a96389b28 (diff)
parenta4a8406c449a2c124659773408d0241d54eb243a (diff)
Merge #5381
5381: ItemTree: Lower tuple types despite invalid type r=flodiebold a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5380 Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/diagnostics/expr.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics/expr.rs b/crates/ra_hir_ty/src/diagnostics/expr.rs
index 91caedc3d..21ff99a8c 100644
--- a/crates/ra_hir_ty/src/diagnostics/expr.rs
+++ b/crates/ra_hir_ty/src/diagnostics/expr.rs
@@ -489,4 +489,27 @@ fn f() {
489"#, 489"#,
490 ) 490 )
491 } 491 }
492
493 #[test]
494 fn enum_variant_type_macro() {
495 check_diagnostics(
496 r#"
497macro_rules! Type {
498 () => { u32 };
499}
500enum Foo {
501 Bar(Type![])
502}
503impl Foo {
504 fn new() {
505 Foo::Bar(0);
506 Foo::Bar(0, 1);
507 //^^^^^^^^^^^^^^ Expected 1 argument, found 2
508 Foo::Bar();
509 //^^^^^^^^^^ Expected 1 argument, found 0
510 }
511}
512 "#,
513 );
514 }
492} 515}