aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-29 15:04:28 +0100
committerGitHub <[email protected]>2019-08-29 15:04:28 +0100
commit7d72ca80003b7915ed7fc64907b5b6dc5c88dacd (patch)
tree4aa7826d1b9a7222ad64085f136a1615d7daa7a5 /crates/ra_hir/src/nameres
parent5a99184967c89992df4544d0c1ca27d79946a1a7 (diff)
parent0f6c048ce1a621ccd3e2080ec5aafbd053c516f4 (diff)
Merge #1738
1738: :arrow_up: insta r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/tests.rs32
-rw-r--r--crates/ra_hir/src/nameres/tests/globs.rs8
-rw-r--r--crates/ra_hir/src/nameres/tests/macros.rs8
-rw-r--r--crates/ra_hir/src/nameres/tests/mods.rs56
-rw-r--r--crates/ra_hir/src/nameres/tests/primitives.rs2
5 files changed, 53 insertions, 53 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index 8b0887fb5..c1dbad283 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -6,7 +6,7 @@ mod mods;
6 6
7use std::sync::Arc; 7use std::sync::Arc;
8 8
9use insta::assert_snapshot_matches; 9use insta::assert_snapshot;
10use ra_db::SourceDatabase; 10use ra_db::SourceDatabase;
11use test_utils::covers; 11use test_utils::covers;
12 12
@@ -97,7 +97,7 @@ fn crate_def_map_smoke_test() {
97 enum E { V } 97 enum E { V }
98 ", 98 ",
99 ); 99 );
100 assert_snapshot_matches!(map, @r###" 100 assert_snapshot!(map, @r###"
101 ⋮crate 101 ⋮crate
102 ⋮E: t 102 ⋮E: t
103 ⋮S: t v 103 ⋮S: t v
@@ -130,7 +130,7 @@ fn bogus_paths() {
130 130
131 ", 131 ",
132 ); 132 );
133 assert_snapshot_matches!(map, @r###" 133 assert_snapshot!(map, @r###"
134 ⋮crate 134 ⋮crate
135 ⋮S: t v 135 ⋮S: t v
136 ⋮foo: t 136 ⋮foo: t
@@ -153,7 +153,7 @@ fn use_as() {
153 pub struct Baz; 153 pub struct Baz;
154 ", 154 ",
155 ); 155 );
156 assert_snapshot_matches!(map, 156 assert_snapshot!(map,
157 @r###" 157 @r###"
158 ⋮crate 158 ⋮crate
159 ⋮Foo: t v 159 ⋮Foo: t v
@@ -182,7 +182,7 @@ fn use_trees() {
182 pub enum Quux {}; 182 pub enum Quux {};
183 ", 183 ",
184 ); 184 );
185 assert_snapshot_matches!(map, @r###" 185 assert_snapshot!(map, @r###"
186 ⋮crate 186 ⋮crate
187 ⋮Baz: t v 187 ⋮Baz: t v
188 ⋮Quux: t 188 ⋮Quux: t
@@ -215,7 +215,7 @@ fn re_exports() {
215 pub struct Baz; 215 pub struct Baz;
216 ", 216 ",
217 ); 217 );
218 assert_snapshot_matches!(map, @r###" 218 assert_snapshot!(map, @r###"
219 ⋮crate 219 ⋮crate
220 ⋮Baz: t v 220 ⋮Baz: t v
221 ⋮foo: t 221 ⋮foo: t
@@ -250,7 +250,7 @@ fn std_prelude() {
250 "test_crate": ("/lib.rs", []), 250 "test_crate": ("/lib.rs", []),
251 }, 251 },
252 ); 252 );
253 assert_snapshot_matches!(map, @r###" 253 assert_snapshot!(map, @r###"
254 ⋮crate 254 ⋮crate
255 ⋮Bar: t v 255 ⋮Bar: t v
256 ⋮Baz: t v 256 ⋮Baz: t v
@@ -267,7 +267,7 @@ fn can_import_enum_variant() {
267 use self::E::V; 267 use self::E::V;
268 ", 268 ",
269 ); 269 );
270 assert_snapshot_matches!(map, @r###" 270 assert_snapshot!(map, @r###"
271 ⋮crate 271 ⋮crate
272 ⋮E: t 272 ⋮E: t
273 ⋮V: t v 273 ⋮V: t v
@@ -299,7 +299,7 @@ fn edition_2015_imports() {
299 }, 299 },
300 ); 300 );
301 301
302 assert_snapshot_matches!(map, @r###" 302 assert_snapshot!(map, @r###"
303 ⋮crate 303 ⋮crate
304 ⋮bar: t 304 ⋮bar: t
305 ⋮foo: t 305 ⋮foo: t
@@ -326,7 +326,7 @@ fn item_map_using_self() {
326 pub struct Baz; 326 pub struct Baz;
327 ", 327 ",
328 ); 328 );
329 assert_snapshot_matches!(map, @r###" 329 assert_snapshot!(map, @r###"
330 ⋮crate 330 ⋮crate
331 ⋮Baz: t v 331 ⋮Baz: t v
332 ⋮foo: t 332 ⋮foo: t
@@ -355,7 +355,7 @@ fn item_map_across_crates() {
355 }, 355 },
356 ); 356 );
357 357
358 assert_snapshot_matches!(map, @r###" 358 assert_snapshot!(map, @r###"
359 ⋮crate 359 ⋮crate
360 ⋮Baz: t v 360 ⋮Baz: t v
361 "###); 361 "###);
@@ -383,7 +383,7 @@ fn extern_crate_rename() {
383 }, 383 },
384 ); 384 );
385 385
386 assert_snapshot_matches!(map, @r###" 386 assert_snapshot!(map, @r###"
387 ⋮crate 387 ⋮crate
388 ⋮alloc_crate: t 388 ⋮alloc_crate: t
389 ⋮sync: t 389 ⋮sync: t
@@ -415,7 +415,7 @@ fn extern_crate_rename_2015_edition() {
415 }, 415 },
416 ); 416 );
417 417
418 assert_snapshot_matches!(map, 418 assert_snapshot!(map,
419 @r###" 419 @r###"
420 ⋮crate 420 ⋮crate
421 ⋮alloc_crate: t 421 ⋮alloc_crate: t
@@ -449,7 +449,7 @@ fn import_across_source_roots() {
449 }, 449 },
450 ); 450 );
451 451
452 assert_snapshot_matches!(map, @r###" 452 assert_snapshot!(map, @r###"
453 ⋮crate 453 ⋮crate
454 ⋮C: t v 454 ⋮C: t v
455 "###); 455 "###);
@@ -476,7 +476,7 @@ fn reexport_across_crates() {
476 }, 476 },
477 ); 477 );
478 478
479 assert_snapshot_matches!(map, @r###" 479 assert_snapshot!(map, @r###"
480 ⋮crate 480 ⋮crate
481 ⋮Baz: t v 481 ⋮Baz: t v
482 "###); 482 "###);
@@ -499,7 +499,7 @@ fn values_dont_shadow_extern_crates() {
499 }, 499 },
500 ); 500 );
501 501
502 assert_snapshot_matches!(map, @r###" 502 assert_snapshot!(map, @r###"
503 ⋮crate 503 ⋮crate
504 ⋮Bar: t v 504 ⋮Bar: t v
505 ⋮foo: v 505 ⋮foo: v
diff --git a/crates/ra_hir/src/nameres/tests/globs.rs b/crates/ra_hir/src/nameres/tests/globs.rs
index e1519ca6b..7ac22b47b 100644
--- a/crates/ra_hir/src/nameres/tests/globs.rs
+++ b/crates/ra_hir/src/nameres/tests/globs.rs
@@ -17,7 +17,7 @@ fn glob_1() {
17 pub struct Baz; 17 pub struct Baz;
18 ", 18 ",
19 ); 19 );
20 assert_snapshot_matches!(map, @r###" 20 assert_snapshot!(map, @r###"
21 ⋮crate 21 ⋮crate
22 ⋮Baz: t v 22 ⋮Baz: t v
23 ⋮Foo: t v 23 ⋮Foo: t v
@@ -53,7 +53,7 @@ fn glob_2() {
53 pub use super::*; 53 pub use super::*;
54 ", 54 ",
55 ); 55 );
56 assert_snapshot_matches!(map, @r###" 56 assert_snapshot!(map, @r###"
57 ⋮crate 57 ⋮crate
58 ⋮Baz: t v 58 ⋮Baz: t v
59 ⋮Foo: t v 59 ⋮Foo: t v
@@ -89,7 +89,7 @@ fn glob_across_crates() {
89 "test_crate": ("/lib.rs", []), 89 "test_crate": ("/lib.rs", []),
90 }, 90 },
91 ); 91 );
92 assert_snapshot_matches!(map, @r###" 92 assert_snapshot!(map, @r###"
93 ⋮crate 93 ⋮crate
94 ⋮Baz: t v 94 ⋮Baz: t v
95 "### 95 "###
@@ -108,7 +108,7 @@ fn glob_enum() {
108 use self::Foo::*; 108 use self::Foo::*;
109 ", 109 ",
110 ); 110 );
111 assert_snapshot_matches!(map, @r###" 111 assert_snapshot!(map, @r###"
112 ⋮crate 112 ⋮crate
113 ⋮Bar: t v 113 ⋮Bar: t v
114 ⋮Baz: t v 114 ⋮Baz: t v
diff --git a/crates/ra_hir/src/nameres/tests/macros.rs b/crates/ra_hir/src/nameres/tests/macros.rs
index 4e04740eb..631df2cef 100644
--- a/crates/ra_hir/src/nameres/tests/macros.rs
+++ b/crates/ra_hir/src/nameres/tests/macros.rs
@@ -17,7 +17,7 @@ fn macro_rules_are_globally_visible() {
17 structs!(Bar, Baz); 17 structs!(Bar, Baz);
18 ", 18 ",
19 ); 19 );
20 assert_snapshot_matches!(map, @r###" 20 assert_snapshot!(map, @r###"
21 ⋮crate 21 ⋮crate
22 ⋮Foo: t v 22 ⋮Foo: t v
23 ⋮nested: t 23 ⋮nested: t
@@ -45,7 +45,7 @@ fn macro_rules_can_define_modules() {
45 struct X; 45 struct X;
46 ", 46 ",
47 ); 47 );
48 assert_snapshot_matches!(map, @r###" 48 assert_snapshot!(map, @r###"
49 ⋮crate 49 ⋮crate
50 ⋮m: m 50 ⋮m: m
51 ⋮n1: t 51 ⋮n1: t
@@ -82,7 +82,7 @@ fn macro_rules_from_other_crates_are_visible() {
82 "foo": ("/lib.rs", []), 82 "foo": ("/lib.rs", []),
83 }, 83 },
84 ); 84 );
85 assert_snapshot_matches!(map, @r###" 85 assert_snapshot!(map, @r###"
86 ⋮crate 86 ⋮crate
87 ⋮Bar: t v 87 ⋮Bar: t v
88 ⋮Foo: t v 88 ⋮Foo: t v
@@ -129,7 +129,7 @@ fn unexpanded_macro_should_expand_by_fixedpoint_loop() {
129 "foo": ("/lib.rs", []), 129 "foo": ("/lib.rs", []),
130 }, 130 },
131 ); 131 );
132 assert_snapshot_matches!(map, @r###" 132 assert_snapshot!(map, @r###"
133 ⋮crate 133 ⋮crate
134 ⋮Foo: t v 134 ⋮Foo: t v
135 ⋮bar: m 135 ⋮bar: m
diff --git a/crates/ra_hir/src/nameres/tests/mods.rs b/crates/ra_hir/src/nameres/tests/mods.rs
index 6dd18df1a..4f8398460 100644
--- a/crates/ra_hir/src/nameres/tests/mods.rs
+++ b/crates/ra_hir/src/nameres/tests/mods.rs
@@ -19,7 +19,7 @@ fn name_res_works_for_broken_modules() {
19 pub struct Baz; 19 pub struct Baz;
20 ", 20 ",
21 ); 21 );
22 assert_snapshot_matches!(map, @r###" 22 assert_snapshot!(map, @r###"
23 ⋮crate 23 ⋮crate
24 ⋮Baz: _ 24 ⋮Baz: _
25 "###); 25 "###);
@@ -41,7 +41,7 @@ fn module_resolution_works_for_non_standard_filenames() {
41 }, 41 },
42 ); 42 );
43 43
44 assert_snapshot_matches!(map, @r###" 44 assert_snapshot!(map, @r###"
45 ⋮crate 45 ⋮crate
46 ⋮Bar: t v 46 ⋮Bar: t v
47 ⋮foo: t 47 ⋮foo: t
@@ -67,7 +67,7 @@ fn module_resolution_works_for_raw_modules() {
67 }, 67 },
68 ); 68 );
69 69
70 assert_snapshot_matches!(map, @r###" 70 assert_snapshot!(map, @r###"
71 ⋮crate 71 ⋮crate
72 ⋮Bar: t v 72 ⋮Bar: t v
73 ⋮async: t 73 ⋮async: t
@@ -94,7 +94,7 @@ fn module_resolution_decl_path() {
94 }, 94 },
95 ); 95 );
96 96
97 assert_snapshot_matches!(map, @r###" 97 assert_snapshot!(map, @r###"
98 ⋮crate 98 ⋮crate
99 ⋮Bar: t v 99 ⋮Bar: t v
100 ⋮foo: t 100 ⋮foo: t
@@ -110,7 +110,7 @@ fn module_resolution_module_with_path_in_mod_rs() {
110 r###" 110 r###"
111 //- /main.rs 111 //- /main.rs
112 mod foo; 112 mod foo;
113 113
114 //- /foo/mod.rs 114 //- /foo/mod.rs
115 #[path = "baz.rs"] 115 #[path = "baz.rs"]
116 pub mod bar; 116 pub mod bar;
@@ -125,7 +125,7 @@ fn module_resolution_module_with_path_in_mod_rs() {
125 }, 125 },
126 ); 126 );
127 127
128 assert_snapshot_matches!(map, @r###" 128 assert_snapshot!(map, @r###"
129 ⋮crate 129 ⋮crate
130 ⋮foo: t 130 ⋮foo: t
131 131
@@ -144,7 +144,7 @@ fn module_resolution_module_with_path_non_crate_root() {
144 r###" 144 r###"
145 //- /main.rs 145 //- /main.rs
146 mod foo; 146 mod foo;
147 147
148 //- /foo.rs 148 //- /foo.rs
149 #[path = "baz.rs"] 149 #[path = "baz.rs"]
150 pub mod bar; 150 pub mod bar;
@@ -159,7 +159,7 @@ fn module_resolution_module_with_path_non_crate_root() {
159 }, 159 },
160 ); 160 );
161 161
162 assert_snapshot_matches!(map, @r###" 162 assert_snapshot!(map, @r###"
163 ⋮crate 163 ⋮crate
164 ⋮foo: t 164 ⋮foo: t
165 165
@@ -189,7 +189,7 @@ fn module_resolution_module_decl_path_super() {
189 }, 189 },
190 ); 190 );
191 191
192 assert_snapshot_matches!(map, @r###" 192 assert_snapshot!(map, @r###"
193 ⋮crate 193 ⋮crate
194 ⋮Baz: t v 194 ⋮Baz: t v
195 ⋮foo: t 195 ⋮foo: t
@@ -215,7 +215,7 @@ fn module_resolution_explicit_path_mod_rs() {
215 }, 215 },
216 ); 216 );
217 217
218 assert_snapshot_matches!(map, @r###" 218 assert_snapshot!(map, @r###"
219 ⋮crate 219 ⋮crate
220 ⋮foo: t 220 ⋮foo: t
221 221
@@ -243,7 +243,7 @@ fn module_resolution_relative_path() {
243 }, 243 },
244 ); 244 );
245 245
246 assert_snapshot_matches!(map, @r###" 246 assert_snapshot!(map, @r###"
247 ⋮crate 247 ⋮crate
248 ⋮foo: t 248 ⋮foo: t
249 249
@@ -274,7 +274,7 @@ fn module_resolution_relative_path_2() {
274 }, 274 },
275 ); 275 );
276 276
277 assert_snapshot_matches!(map, @r###" 277 assert_snapshot!(map, @r###"
278 ⋮crate 278 ⋮crate
279 ⋮foo: t 279 ⋮foo: t
280 280
@@ -302,7 +302,7 @@ fn module_resolution_explicit_path_mod_rs_2() {
302 }, 302 },
303 ); 303 );
304 304
305 assert_snapshot_matches!(map, @r###" 305 assert_snapshot!(map, @r###"
306 ⋮crate 306 ⋮crate
307 ⋮foo: t 307 ⋮foo: t
308 308
@@ -327,7 +327,7 @@ fn module_resolution_explicit_path_mod_rs_with_win_separator() {
327 }, 327 },
328 ); 328 );
329 329
330 assert_snapshot_matches!(map, @r###" 330 assert_snapshot!(map, @r###"
331 ⋮crate 331 ⋮crate
332 ⋮foo: t 332 ⋮foo: t
333 333
@@ -354,7 +354,7 @@ fn module_resolution_decl_inside_inline_module_with_path_attribute() {
354 }, 354 },
355 ); 355 );
356 356
357 assert_snapshot_matches!(map, @r###" 357 assert_snapshot!(map, @r###"
358 ⋮crate 358 ⋮crate
359 ⋮foo: t 359 ⋮foo: t
360 360
@@ -383,7 +383,7 @@ fn module_resolution_decl_inside_inline_module() {
383 }, 383 },
384 ); 384 );
385 385
386 assert_snapshot_matches!(map, @r###" 386 assert_snapshot!(map, @r###"
387 ⋮crate 387 ⋮crate
388 ⋮foo: t 388 ⋮foo: t
389 389
@@ -413,7 +413,7 @@ fn module_resolution_decl_inside_inline_module_2_with_path_attribute() {
413 }, 413 },
414 ); 414 );
415 415
416 assert_snapshot_matches!(map, @r###" 416 assert_snapshot!(map, @r###"
417 ⋮crate 417 ⋮crate
418 ⋮foo: t 418 ⋮foo: t
419 419
@@ -444,7 +444,7 @@ fn module_resolution_decl_inside_inline_module_3() {
444 }, 444 },
445 ); 445 );
446 446
447 assert_snapshot_matches!(map, @r###" 447 assert_snapshot!(map, @r###"
448 ⋮crate 448 ⋮crate
449 ⋮foo: t 449 ⋮foo: t
450 450
@@ -475,7 +475,7 @@ fn module_resolution_decl_inside_inline_module_empty_path() {
475 }, 475 },
476 ); 476 );
477 477
478 assert_snapshot_matches!(map, @r###" 478 assert_snapshot!(map, @r###"
479 ⋮crate 479 ⋮crate
480 ⋮foo: t 480 ⋮foo: t
481 481
@@ -503,7 +503,7 @@ fn module_resolution_decl_empty_path() {
503 }, 503 },
504 ); 504 );
505 505
506 assert_snapshot_matches!(map, @r###" 506 assert_snapshot!(map, @r###"
507 ⋮crate 507 ⋮crate
508 ⋮foo: t 508 ⋮foo: t
509 509
@@ -530,7 +530,7 @@ fn module_resolution_decl_inside_inline_module_relative_path() {
530 }, 530 },
531 ); 531 );
532 532
533 assert_snapshot_matches!(map, @r###" 533 assert_snapshot!(map, @r###"
534 ⋮crate 534 ⋮crate
535 ⋮foo: t 535 ⋮foo: t
536 536
@@ -561,7 +561,7 @@ fn module_resolution_decl_inside_inline_module_in_crate_root() {
561 }, 561 },
562 ); 562 );
563 563
564 assert_snapshot_matches!(map, @r###" 564 assert_snapshot!(map, @r###"
565 ⋮crate 565 ⋮crate
566 ⋮Baz: t v 566 ⋮Baz: t v
567 ⋮foo: t 567 ⋮foo: t
@@ -596,7 +596,7 @@ fn module_resolution_decl_inside_inline_module_in_mod_rs() {
596 }, 596 },
597 ); 597 );
598 598
599 assert_snapshot_matches!(map, @r###" 599 assert_snapshot!(map, @r###"
600 ⋮crate 600 ⋮crate
601 ⋮foo: t 601 ⋮foo: t
602 602
@@ -634,7 +634,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() {
634 }, 634 },
635 ); 635 );
636 636
637 assert_snapshot_matches!(map, @r###" 637 assert_snapshot!(map, @r###"
638 ⋮crate 638 ⋮crate
639 ⋮foo: t 639 ⋮foo: t
640 640
@@ -672,7 +672,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() {
672 }, 672 },
673 ); 673 );
674 674
675 assert_snapshot_matches!(map, @r###" 675 assert_snapshot!(map, @r###"
676 ⋮crate 676 ⋮crate
677 ⋮foo: t 677 ⋮foo: t
678 678
@@ -701,8 +701,8 @@ fn unresolved_module_diagnostics() {
701 ) 701 )
702 .diagnostics(); 702 .diagnostics();
703 703
704 assert_snapshot_matches!(diagnostics, @r###" 704 assert_snapshot!(diagnostics, @r###"
705"mod bar;": unresolved module 705 "mod bar;": unresolved module
706"### 706 "###
707 ); 707 );
708} 708}
diff --git a/crates/ra_hir/src/nameres/tests/primitives.rs b/crates/ra_hir/src/nameres/tests/primitives.rs
index 734744835..0e2708658 100644
--- a/crates/ra_hir/src/nameres/tests/primitives.rs
+++ b/crates/ra_hir/src/nameres/tests/primitives.rs
@@ -12,7 +12,7 @@ fn primitive_reexport() {
12 pub use i32 as int; 12 pub use i32 as int;
13 ", 13 ",
14 ); 14 );
15 assert_snapshot_matches!(map, @r###" 15 assert_snapshot!(map, @r###"
16 ⋮crate 16 ⋮crate
17 ⋮foo: t 17 ⋮foo: t
18 ⋮int: t 18 ⋮int: t