diff options
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r-- | crates/ra_ide/src/goto_definition.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs index 76a741207..d3c198813 100644 --- a/crates/ra_ide/src/goto_definition.rs +++ b/crates/ra_ide/src/goto_definition.rs | |||
@@ -689,8 +689,38 @@ mod tests { | |||
689 | fo<|>o(); | 689 | fo<|>o(); |
690 | } | 690 | } |
691 | } | 691 | } |
692 | mod confuse_index { fn foo(); } | ||
692 | ", | 693 | ", |
693 | "foo FN_DEF FileId(1) [52; 63) [55; 58)", | 694 | "foo FN_DEF FileId(1) [52; 63) [55; 58)", |
694 | ); | 695 | ); |
695 | } | 696 | } |
697 | |||
698 | #[should_panic] // currently failing because of expr mapping problems | ||
699 | #[test] | ||
700 | fn goto_through_format() { | ||
701 | check_goto( | ||
702 | " | ||
703 | //- /lib.rs | ||
704 | #[macro_export] | ||
705 | macro_rules! format { | ||
706 | ($($arg:tt)*) => ($crate::fmt::format($crate::__export::format_args!($($arg)*))) | ||
707 | } | ||
708 | #[rustc_builtin_macro] | ||
709 | #[macro_export] | ||
710 | macro_rules! format_args { | ||
711 | ($fmt:expr) => ({ /* compiler built-in */ }); | ||
712 | ($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ }) | ||
713 | } | ||
714 | pub mod __export { | ||
715 | pub use crate::format_args; | ||
716 | fn foo() {} // for index confusion | ||
717 | } | ||
718 | fn foo() -> i8 {} | ||
719 | fn test() { | ||
720 | format!(\"{}\", fo<|>o()) | ||
721 | } | ||
722 | ", | ||
723 | "foo FN_DEF FileId(1) [359; 376) [362; 365)", | ||
724 | ); | ||
725 | } | ||
696 | } | 726 | } |