diff options
Diffstat (limited to 'crates/hir_ty/src/tests/macros.rs')
-rw-r--r-- | crates/hir_ty/src/tests/macros.rs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/crates/hir_ty/src/tests/macros.rs b/crates/hir_ty/src/tests/macros.rs index d14103aab..2cf41e49e 100644 --- a/crates/hir_ty/src/tests/macros.rs +++ b/crates/hir_ty/src/tests/macros.rs | |||
@@ -435,11 +435,11 @@ fn processes_impls_generated_by_macros() { | |||
435 | macro_rules! m { | 435 | macro_rules! m { |
436 | ($ident:ident) => (impl Trait for $ident {}) | 436 | ($ident:ident) => (impl Trait for $ident {}) |
437 | } | 437 | } |
438 | trait Trait { fn foo(self) -> u128 {} } | 438 | trait Trait { fn foo(self) -> u128 { 0 } } |
439 | struct S; | 439 | struct S; |
440 | m!(S); | 440 | m!(S); |
441 | fn test() { S.foo(); } | 441 | fn test() { S.foo(); } |
442 | //^ u128 | 442 | //^^^^^^^ u128 |
443 | "#, | 443 | "#, |
444 | ); | 444 | ); |
445 | } | 445 | } |
@@ -457,7 +457,7 @@ impl S { | |||
457 | } | 457 | } |
458 | 458 | ||
459 | fn test() { S.foo(); } | 459 | fn test() { S.foo(); } |
460 | //^ u128 | 460 | //^^^^^^^ u128 |
461 | "#, | 461 | "#, |
462 | ); | 462 | ); |
463 | } | 463 | } |
@@ -479,7 +479,7 @@ impl S { | |||
479 | } | 479 | } |
480 | 480 | ||
481 | fn test() { S.foo(); } | 481 | fn test() { S.foo(); } |
482 | //^ u128 | 482 | //^^^^^^^ u128 |
483 | "#, | 483 | "#, |
484 | ); | 484 | ); |
485 | } | 485 | } |
@@ -743,7 +743,7 @@ include!("foo.rs"); | |||
743 | 743 | ||
744 | fn main() { | 744 | fn main() { |
745 | bar(); | 745 | bar(); |
746 | } //^ u32 | 746 | } //^^^^^ u32 |
747 | 747 | ||
748 | //- /foo.rs | 748 | //- /foo.rs |
749 | fn bar() -> u32 {0} | 749 | fn bar() -> u32 {0} |
@@ -781,7 +781,7 @@ include!("f/foo.rs"); | |||
781 | 781 | ||
782 | fn main() { | 782 | fn main() { |
783 | bar::bar(); | 783 | bar::bar(); |
784 | } //^ u32 | 784 | } //^^^^^^^^^^ u32 |
785 | 785 | ||
786 | //- /f/foo.rs | 786 | //- /f/foo.rs |
787 | pub mod bar; | 787 | pub mod bar; |
@@ -853,7 +853,7 @@ include!("foo.rs"); | |||
853 | 853 | ||
854 | fn main() { | 854 | fn main() { |
855 | RegisterBlock { }; | 855 | RegisterBlock { }; |
856 | //^ RegisterBlock | 856 | //^^^^^^^^^^^^^^^^^ RegisterBlock |
857 | } | 857 | } |
858 | "#; | 858 | "#; |
859 | let fixture = format!("{}\n//- /foo.rs\n{}", fixture, data); | 859 | let fixture = format!("{}\n//- /foo.rs\n{}", fixture, data); |
@@ -879,7 +879,7 @@ include!(concat!("f", "oo.rs")); | |||
879 | 879 | ||
880 | fn main() { | 880 | fn main() { |
881 | bar(); | 881 | bar(); |
882 | } //^ u32 | 882 | } //^^^^^ u32 |
883 | 883 | ||
884 | //- /foo.rs | 884 | //- /foo.rs |
885 | fn bar() -> u32 {0} | 885 | fn bar() -> u32 {0} |
@@ -905,7 +905,7 @@ include!(concat!(env!("OUT_DIR"), "/foo.rs")); | |||
905 | 905 | ||
906 | fn main() { | 906 | fn main() { |
907 | bar(); | 907 | bar(); |
908 | } //^ {unknown} | 908 | } //^^^^^ {unknown} |
909 | 909 | ||
910 | //- /foo.rs | 910 | //- /foo.rs |
911 | fn bar() -> u32 {0} | 911 | fn bar() -> u32 {0} |
@@ -923,7 +923,7 @@ macro_rules! include {() => {}} | |||
923 | include!("main.rs"); | 923 | include!("main.rs"); |
924 | 924 | ||
925 | fn main() { | 925 | fn main() { |
926 | 0 | 926 | 0; |
927 | } //^ i32 | 927 | } //^ i32 |
928 | "#, | 928 | "#, |
929 | ); | 929 | ); |
@@ -979,7 +979,7 @@ fn infer_derive_clone_simple() { | |||
979 | struct S; | 979 | struct S; |
980 | fn test() { | 980 | fn test() { |
981 | S.clone(); | 981 | S.clone(); |
982 | } //^ S | 982 | } //^^^^^^^^^ S |
983 | 983 | ||
984 | //- /lib.rs crate:core | 984 | //- /lib.rs crate:core |
985 | pub mod prelude { | 985 | pub mod prelude { |
@@ -1028,7 +1028,7 @@ pub struct S; | |||
1028 | use core::S; | 1028 | use core::S; |
1029 | fn test() { | 1029 | fn test() { |
1030 | S.clone(); | 1030 | S.clone(); |
1031 | } //^ S | 1031 | } //^^^^^^^^^ S |
1032 | "#, | 1032 | "#, |
1033 | ); | 1033 | ); |
1034 | } | 1034 | } |
@@ -1044,7 +1044,8 @@ struct S; | |||
1044 | struct Wrapper<T>(T); | 1044 | struct Wrapper<T>(T); |
1045 | struct NonClone; | 1045 | struct NonClone; |
1046 | fn test() { | 1046 | fn test() { |
1047 | (Wrapper(S).clone(), Wrapper(NonClone).clone()); | 1047 | let x = (Wrapper(S).clone(), Wrapper(NonClone).clone()); |
1048 | x; | ||
1048 | //^ (Wrapper<S>, {unknown}) | 1049 | //^ (Wrapper<S>, {unknown}) |
1049 | } | 1050 | } |
1050 | 1051 | ||
@@ -1079,7 +1080,7 @@ struct S{} | |||
1079 | 1080 | ||
1080 | fn test() { | 1081 | fn test() { |
1081 | S{}; | 1082 | S{}; |
1082 | } //^ S | 1083 | } //^^^ S |
1083 | "#, | 1084 | "#, |
1084 | ); | 1085 | ); |
1085 | } | 1086 | } |