aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/ty/tests.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index 8d8a0eaaa..86f18b487 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -627,6 +627,28 @@ fn test(a: A) {
627} 627}
628 628
629#[test] 629#[test]
630fn infer_inherent_method_str() {
631 assert_snapshot_matches!(
632 infer(r#"
633#[lang = "str"]
634impl str {
635 fn foo(&self) -> i32 {}
636}
637
638fn test() {
639 "foo".foo();
640}
641"#),
642 @r###"
643[40; 44) 'self': &str
644[53; 55) '{}': ()
645[69; 89) '{ ...o(); }': ()
646[75; 80) '"foo"': &str
647[75; 86) '"foo".foo()': i32"###
648 );
649}
650
651#[test]
630fn infer_tuple() { 652fn infer_tuple() {
631 assert_snapshot_matches!( 653 assert_snapshot_matches!(
632 infer(r#" 654 infer(r#"