diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-17 10:43:14 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-17 10:43:14 +0000 |
commit | 2720e2374be951bb762ff2815dd67c7ffe3419b7 (patch) | |
tree | ff98e8e779dfe2c7e2a3eebf84dca6020f5db1b2 /crates/ra_hir_def/src/nameres | |
parent | 089c5547709bb8e7e60388c4f9a5e25c394c1f39 (diff) | |
parent | de7662c852353febce09196199202ee7f6e8e6c3 (diff) |
Merge #3626
3626: Check that no file contains trailing ws r=matklad a=matklad
rustfmt allows trailing spaces in string literals unfortunately.
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests/globs.rs | 92 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests/macros.rs | 34 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests/mod_resolution.rs | 84 |
4 files changed, 107 insertions, 107 deletions
diff --git a/crates/ra_hir_def/src/nameres/tests.rs b/crates/ra_hir_def/src/nameres/tests.rs index 3f33a75b9..949ca7595 100644 --- a/crates/ra_hir_def/src/nameres/tests.rs +++ b/crates/ra_hir_def/src/nameres/tests.rs | |||
@@ -12,8 +12,8 @@ use test_utils::covers; | |||
12 | 12 | ||
13 | use crate::{db::DefDatabase, nameres::*, test_db::TestDB}; | 13 | use crate::{db::DefDatabase, nameres::*, test_db::TestDB}; |
14 | 14 | ||
15 | fn def_map(fixture: &str) -> String { | 15 | fn def_map(ra_fixture: &str) -> String { |
16 | compute_crate_def_map(fixture).dump() | 16 | compute_crate_def_map(ra_fixture).dump() |
17 | } | 17 | } |
18 | 18 | ||
19 | fn compute_crate_def_map(fixture: &str) -> Arc<CrateDefMap> { | 19 | fn compute_crate_def_map(fixture: &str) -> Arc<CrateDefMap> { |
diff --git a/crates/ra_hir_def/src/nameres/tests/globs.rs b/crates/ra_hir_def/src/nameres/tests/globs.rs index 71fa0abe8..ee8df3a26 100644 --- a/crates/ra_hir_def/src/nameres/tests/globs.rs +++ b/crates/ra_hir_def/src/nameres/tests/globs.rs | |||
@@ -3,7 +3,7 @@ use super::*; | |||
3 | #[test] | 3 | #[test] |
4 | fn glob_1() { | 4 | fn glob_1() { |
5 | let map = def_map( | 5 | let map = def_map( |
6 | " | 6 | r" |
7 | //- /lib.rs | 7 | //- /lib.rs |
8 | mod foo; | 8 | mod foo; |
9 | use foo::*; | 9 | use foo::*; |
@@ -76,7 +76,7 @@ fn glob_2() { | |||
76 | #[test] | 76 | #[test] |
77 | fn glob_privacy_1() { | 77 | fn glob_privacy_1() { |
78 | let map = def_map( | 78 | let map = def_map( |
79 | " | 79 | r" |
80 | //- /lib.rs | 80 | //- /lib.rs |
81 | mod foo; | 81 | mod foo; |
82 | use foo::*; | 82 | use foo::*; |
@@ -93,21 +93,21 @@ fn glob_privacy_1() { | |||
93 | ", | 93 | ", |
94 | ); | 94 | ); |
95 | assert_snapshot!(map, @r###" | 95 | assert_snapshot!(map, @r###" |
96 | crate | 96 | â‹®crate |
97 | Baz: t v | 97 | â‹®Baz: t v |
98 | bar: t | 98 | â‹®bar: t |
99 | foo: t | 99 | â‹®foo: t |
100 | 100 | â‹® | |
101 | crate::foo | 101 | â‹®crate::foo |
102 | Baz: t v | 102 | â‹®Baz: t v |
103 | PrivateStructFoo: t v | 103 | â‹®PrivateStructFoo: t v |
104 | bar: t | 104 | â‹®bar: t |
105 | 105 | â‹® | |
106 | crate::foo::bar | 106 | â‹®crate::foo::bar |
107 | Baz: t v | 107 | â‹®Baz: t v |
108 | PrivateStructBar: t v | 108 | â‹®PrivateStructBar: t v |
109 | PrivateStructFoo: t v | 109 | â‹®PrivateStructFoo: t v |
110 | bar: t | 110 | â‹®bar: t |
111 | "### | 111 | "### |
112 | ); | 112 | ); |
113 | } | 113 | } |
@@ -115,7 +115,7 @@ fn glob_privacy_1() { | |||
115 | #[test] | 115 | #[test] |
116 | fn glob_privacy_2() { | 116 | fn glob_privacy_2() { |
117 | let map = def_map( | 117 | let map = def_map( |
118 | " | 118 | r" |
119 | //- /lib.rs | 119 | //- /lib.rs |
120 | mod foo; | 120 | mod foo; |
121 | use foo::*; | 121 | use foo::*; |
@@ -133,19 +133,19 @@ fn glob_privacy_2() { | |||
133 | ", | 133 | ", |
134 | ); | 134 | ); |
135 | assert_snapshot!(map, @r###" | 135 | assert_snapshot!(map, @r###" |
136 | crate | 136 | â‹®crate |
137 | Foo: t | 137 | â‹®Foo: t |
138 | PubCrateStruct: t v | 138 | â‹®PubCrateStruct: t v |
139 | foo: t | 139 | â‹®foo: t |
140 | 140 | â‹® | |
141 | crate::foo | 141 | â‹®crate::foo |
142 | Foo: t v | 142 | â‹®Foo: t v |
143 | bar: t | 143 | â‹®bar: t |
144 | 144 | â‹® | |
145 | crate::foo::bar | 145 | â‹®crate::foo::bar |
146 | PrivateBar: t v | 146 | â‹®PrivateBar: t v |
147 | PrivateBaz: t v | 147 | â‹®PrivateBaz: t v |
148 | PubCrateStruct: t v | 148 | â‹®PubCrateStruct: t v |
149 | "### | 149 | "### |
150 | ); | 150 | ); |
151 | } | 151 | } |
@@ -154,7 +154,7 @@ fn glob_privacy_2() { | |||
154 | fn glob_across_crates() { | 154 | fn glob_across_crates() { |
155 | covers!(glob_across_crates); | 155 | covers!(glob_across_crates); |
156 | let map = def_map( | 156 | let map = def_map( |
157 | " | 157 | r" |
158 | //- /main.rs crate:main deps:test_crate | 158 | //- /main.rs crate:main deps:test_crate |
159 | use test_crate::*; | 159 | use test_crate::*; |
160 | 160 | ||
@@ -163,8 +163,8 @@ fn glob_across_crates() { | |||
163 | ", | 163 | ", |
164 | ); | 164 | ); |
165 | assert_snapshot!(map, @r###" | 165 | assert_snapshot!(map, @r###" |
166 | â‹®crate | 166 | â‹®crate |
167 | â‹®Baz: t v | 167 | â‹®Baz: t v |
168 | "### | 168 | "### |
169 | ); | 169 | ); |
170 | } | 170 | } |
@@ -173,7 +173,7 @@ fn glob_across_crates() { | |||
173 | fn glob_privacy_across_crates() { | 173 | fn glob_privacy_across_crates() { |
174 | covers!(glob_across_crates); | 174 | covers!(glob_across_crates); |
175 | let map = def_map( | 175 | let map = def_map( |
176 | " | 176 | r" |
177 | //- /main.rs crate:main deps:test_crate | 177 | //- /main.rs crate:main deps:test_crate |
178 | use test_crate::*; | 178 | use test_crate::*; |
179 | 179 | ||
@@ -183,8 +183,8 @@ fn glob_privacy_across_crates() { | |||
183 | ", | 183 | ", |
184 | ); | 184 | ); |
185 | assert_snapshot!(map, @r###" | 185 | assert_snapshot!(map, @r###" |
186 | â‹®crate | 186 | â‹®crate |
187 | â‹®Baz: t v | 187 | â‹®Baz: t v |
188 | "### | 188 | "### |
189 | ); | 189 | ); |
190 | } | 190 | } |
@@ -202,10 +202,10 @@ fn glob_enum() { | |||
202 | ", | 202 | ", |
203 | ); | 203 | ); |
204 | assert_snapshot!(map, @r###" | 204 | assert_snapshot!(map, @r###" |
205 | â‹®crate | 205 | â‹®crate |
206 | â‹®Bar: t v | 206 | â‹®Bar: t v |
207 | â‹®Baz: t v | 207 | â‹®Baz: t v |
208 | â‹®Foo: t | 208 | â‹®Foo: t |
209 | "### | 209 | "### |
210 | ); | 210 | ); |
211 | } | 211 | } |
@@ -214,7 +214,7 @@ fn glob_enum() { | |||
214 | fn glob_enum_group() { | 214 | fn glob_enum_group() { |
215 | covers!(glob_enum_group); | 215 | covers!(glob_enum_group); |
216 | let map = def_map( | 216 | let map = def_map( |
217 | " | 217 | r" |
218 | //- /lib.rs | 218 | //- /lib.rs |
219 | enum Foo { | 219 | enum Foo { |
220 | Bar, Baz | 220 | Bar, Baz |
@@ -223,10 +223,10 @@ fn glob_enum_group() { | |||
223 | ", | 223 | ", |
224 | ); | 224 | ); |
225 | assert_snapshot!(map, @r###" | 225 | assert_snapshot!(map, @r###" |
226 | â‹®crate | 226 | â‹®crate |
227 | â‹®Bar: t v | 227 | â‹®Bar: t v |
228 | â‹®Baz: t v | 228 | â‹®Baz: t v |
229 | â‹®Foo: t | 229 | â‹®Foo: t |
230 | "### | 230 | "### |
231 | ); | 231 | ); |
232 | } | 232 | } |
diff --git a/crates/ra_hir_def/src/nameres/tests/macros.rs b/crates/ra_hir_def/src/nameres/tests/macros.rs index d104f5993..b0befdfbd 100644 --- a/crates/ra_hir_def/src/nameres/tests/macros.rs +++ b/crates/ra_hir_def/src/nameres/tests/macros.rs | |||
@@ -3,7 +3,7 @@ use super::*; | |||
3 | #[test] | 3 | #[test] |
4 | fn macro_rules_are_globally_visible() { | 4 | fn macro_rules_are_globally_visible() { |
5 | let map = def_map( | 5 | let map = def_map( |
6 | " | 6 | r" |
7 | //- /lib.rs | 7 | //- /lib.rs |
8 | macro_rules! structs { | 8 | macro_rules! structs { |
9 | ($($i:ident),*) => { | 9 | ($($i:ident),*) => { |
@@ -31,7 +31,7 @@ fn macro_rules_are_globally_visible() { | |||
31 | #[test] | 31 | #[test] |
32 | fn macro_rules_can_define_modules() { | 32 | fn macro_rules_can_define_modules() { |
33 | let map = def_map( | 33 | let map = def_map( |
34 | " | 34 | r" |
35 | //- /lib.rs | 35 | //- /lib.rs |
36 | macro_rules! m { | 36 | macro_rules! m { |
37 | ($name:ident) => { mod $name; } | 37 | ($name:ident) => { mod $name; } |
@@ -51,21 +51,21 @@ fn macro_rules_can_define_modules() { | |||
51 | ", | 51 | ", |
52 | ); | 52 | ); |
53 | assert_snapshot!(map, @r###" | 53 | assert_snapshot!(map, @r###" |
54 | crate | 54 | â‹®crate |
55 | m: t | 55 | â‹®m: t |
56 | n1: t | 56 | â‹®n1: t |
57 | 57 | â‹® | |
58 | crate::m | 58 | â‹®crate::m |
59 | n3: t | 59 | â‹®n3: t |
60 | 60 | â‹® | |
61 | crate::m::n3 | 61 | â‹®crate::m::n3 |
62 | Y: t v | 62 | â‹®Y: t v |
63 | 63 | â‹® | |
64 | crate::n1 | 64 | â‹®crate::n1 |
65 | n2: t | 65 | â‹®n2: t |
66 | 66 | â‹® | |
67 | crate::n1::n2 | 67 | â‹®crate::n1::n2 |
68 | X: t v | 68 | â‹®X: t v |
69 | "###); | 69 | "###); |
70 | } | 70 | } |
71 | 71 | ||
diff --git a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs index 22103ab29..b502a4079 100644 --- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs | |||
@@ -4,7 +4,7 @@ use super::*; | |||
4 | fn name_res_works_for_broken_modules() { | 4 | fn name_res_works_for_broken_modules() { |
5 | covers!(name_res_works_for_broken_modules); | 5 | covers!(name_res_works_for_broken_modules); |
6 | let map = def_map( | 6 | let map = def_map( |
7 | " | 7 | r" |
8 | //- /lib.rs | 8 | //- /lib.rs |
9 | mod foo // no `;`, no body | 9 | mod foo // no `;`, no body |
10 | 10 | ||
@@ -28,7 +28,7 @@ fn name_res_works_for_broken_modules() { | |||
28 | #[test] | 28 | #[test] |
29 | fn nested_module_resolution() { | 29 | fn nested_module_resolution() { |
30 | let map = def_map( | 30 | let map = def_map( |
31 | " | 31 | r" |
32 | //- /lib.rs | 32 | //- /lib.rs |
33 | mod n1; | 33 | mod n1; |
34 | 34 | ||
@@ -55,7 +55,7 @@ fn nested_module_resolution() { | |||
55 | #[test] | 55 | #[test] |
56 | fn nested_module_resolution_2() { | 56 | fn nested_module_resolution_2() { |
57 | let map = def_map( | 57 | let map = def_map( |
58 | " | 58 | r" |
59 | //- /lib.rs | 59 | //- /lib.rs |
60 | mod prelude; | 60 | mod prelude; |
61 | mod iter; | 61 | mod iter; |
@@ -77,23 +77,23 @@ fn nested_module_resolution_2() { | |||
77 | ); | 77 | ); |
78 | 78 | ||
79 | assert_snapshot!(map, @r###" | 79 | assert_snapshot!(map, @r###" |
80 | crate | 80 | â‹®crate |
81 | iter: t | 81 | â‹®iter: t |
82 | prelude: t | 82 | â‹®prelude: t |
83 | 83 | â‹® | |
84 | crate::iter | 84 | â‹®crate::iter |
85 | Iterator: t | 85 | â‹®Iterator: t |
86 | traits: t | 86 | â‹®traits: t |
87 | 87 | â‹® | |
88 | crate::iter::traits | 88 | â‹®crate::iter::traits |
89 | Iterator: t | 89 | â‹®Iterator: t |
90 | iterator: t | 90 | â‹®iterator: t |
91 | 91 | â‹® | |
92 | crate::iter::traits::iterator | 92 | â‹®crate::iter::traits::iterator |
93 | Iterator: t | 93 | â‹®Iterator: t |
94 | 94 | â‹® | |
95 | crate::prelude | 95 | â‹®crate::prelude |
96 | Iterator: t | 96 | â‹®Iterator: t |
97 | "###); | 97 | "###); |
98 | } | 98 | } |
99 | 99 | ||
@@ -780,17 +780,17 @@ fn nested_out_of_line_module() { | |||
780 | ); | 780 | ); |
781 | 781 | ||
782 | assert_snapshot!(map, @r###" | 782 | assert_snapshot!(map, @r###" |
783 | crate | 783 | â‹®crate |
784 | a: t | 784 | â‹®a: t |
785 | 785 | â‹® | |
786 | crate::a | 786 | â‹®crate::a |
787 | b: t | 787 | â‹®b: t |
788 | 788 | â‹® | |
789 | crate::a::b | 789 | â‹®crate::a::b |
790 | c: t | 790 | â‹®c: t |
791 | 791 | â‹® | |
792 | crate::a::b::c | 792 | â‹®crate::a::b::c |
793 | X: t v | 793 | â‹®X: t v |
794 | "###); | 794 | "###); |
795 | } | 795 | } |
796 | 796 | ||
@@ -812,16 +812,16 @@ fn nested_out_of_line_module_with_path() { | |||
812 | ); | 812 | ); |
813 | 813 | ||
814 | assert_snapshot!(map, @r###" | 814 | assert_snapshot!(map, @r###" |
815 | crate | 815 | â‹®crate |
816 | a: t | 816 | â‹®a: t |
817 | 817 | â‹® | |
818 | crate::a | 818 | â‹®crate::a |
819 | b: t | 819 | â‹®b: t |
820 | 820 | â‹® | |
821 | crate::a::b | 821 | â‹®crate::a::b |
822 | c: t | 822 | â‹®c: t |
823 | 823 | â‹® | |
824 | crate::a::b::c | 824 | â‹®crate::a::b::c |
825 | X: t v | 825 | â‹®X: t v |
826 | "###); | 826 | "###); |
827 | } | 827 | } |