]> git.lizzy.rs Git - rust.git/blob - crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
Fix tests
[rust.git] / crates / rust-analyzer / src / diagnostics / test_data / clippy_pass_by_ref.txt
1 [
2     MappedRustDiagnostic {
3         url: Url {
4             scheme: "file",
5             cannot_be_a_base: false,
6             username: "",
7             password: None,
8             host: None,
9             port: None,
10             path: "/test/compiler/mir/tagset.rs",
11             query: None,
12             fragment: None,
13         },
14         diagnostic: Diagnostic {
15             range: Range {
16                 start: Position {
17                     line: 41,
18                     character: 23,
19                 },
20                 end: Position {
21                     line: 41,
22                     character: 28,
23                 },
24             },
25             severity: Some(
26                 DiagnosticSeverity(
27                     2,
28                 ),
29             ),
30             code: Some(
31                 String(
32                     "trivially_copy_pass_by_ref",
33                 ),
34             ),
35             code_description: Some(
36                 CodeDescription {
37                     href: Url {
38                         scheme: "https",
39                         cannot_be_a_base: false,
40                         username: "",
41                         password: None,
42                         host: Some(
43                             Domain(
44                                 "rust-lang.github.io",
45                             ),
46                         ),
47                         port: None,
48                         path: "/rust-clippy/master/index.html",
49                         query: None,
50                         fragment: Some(
51                             "trivially_copy_pass_by_ref",
52                         ),
53                     },
54                 },
55             ),
56             source: Some(
57                 "clippy",
58             ),
59             message: "this argument is passed by reference, but would be more efficient if passed by value\n#[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]\nfor further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref",
60             related_information: Some(
61                 [
62                     DiagnosticRelatedInformation {
63                         location: Location {
64                             uri: Url {
65                                 scheme: "file",
66                                 cannot_be_a_base: false,
67                                 username: "",
68                                 password: None,
69                                 host: None,
70                                 port: None,
71                                 path: "/test/compiler/lib.rs",
72                                 query: None,
73                                 fragment: None,
74                             },
75                             range: Range {
76                                 start: Position {
77                                     line: 0,
78                                     character: 8,
79                                 },
80                                 end: Position {
81                                     line: 0,
82                                     character: 19,
83                                 },
84                             },
85                         },
86                         message: "lint level defined here",
87                     },
88                     DiagnosticRelatedInformation {
89                         location: Location {
90                             uri: Url {
91                                 scheme: "file",
92                                 cannot_be_a_base: false,
93                                 username: "",
94                                 password: None,
95                                 host: None,
96                                 port: None,
97                                 path: "/test/compiler/mir/tagset.rs",
98                                 query: None,
99                                 fragment: None,
100                             },
101                             range: Range {
102                                 start: Position {
103                                     line: 41,
104                                     character: 23,
105                                 },
106                                 end: Position {
107                                     line: 41,
108                                     character: 28,
109                                 },
110                             },
111                         },
112                         message: "consider passing by value instead: `self`",
113                     },
114                 ],
115             ),
116             tags: None,
117             data: None,
118         },
119         fixes: [],
120     },
121     MappedRustDiagnostic {
122         url: Url {
123             scheme: "file",
124             cannot_be_a_base: false,
125             username: "",
126             password: None,
127             host: None,
128             port: None,
129             path: "/test/compiler/lib.rs",
130             query: None,
131             fragment: None,
132         },
133         diagnostic: Diagnostic {
134             range: Range {
135                 start: Position {
136                     line: 0,
137                     character: 8,
138                 },
139                 end: Position {
140                     line: 0,
141                     character: 19,
142                 },
143             },
144             severity: Some(
145                 DiagnosticSeverity(
146                     4,
147                 ),
148             ),
149             code: Some(
150                 String(
151                     "trivially_copy_pass_by_ref",
152                 ),
153             ),
154             code_description: Some(
155                 CodeDescription {
156                     href: Url {
157                         scheme: "https",
158                         cannot_be_a_base: false,
159                         username: "",
160                         password: None,
161                         host: Some(
162                             Domain(
163                                 "rust-lang.github.io",
164                             ),
165                         ),
166                         port: None,
167                         path: "/rust-clippy/master/index.html",
168                         query: None,
169                         fragment: Some(
170                             "trivially_copy_pass_by_ref",
171                         ),
172                     },
173                 },
174             ),
175             source: Some(
176                 "clippy",
177             ),
178             message: "lint level defined here",
179             related_information: Some(
180                 [
181                     DiagnosticRelatedInformation {
182                         location: Location {
183                             uri: Url {
184                                 scheme: "file",
185                                 cannot_be_a_base: false,
186                                 username: "",
187                                 password: None,
188                                 host: None,
189                                 port: None,
190                                 path: "/test/compiler/mir/tagset.rs",
191                                 query: None,
192                                 fragment: None,
193                             },
194                             range: Range {
195                                 start: Position {
196                                     line: 41,
197                                     character: 23,
198                                 },
199                                 end: Position {
200                                     line: 41,
201                                     character: 28,
202                                 },
203                             },
204                         },
205                         message: "original diagnostic",
206                     },
207                 ],
208             ),
209             tags: None,
210             data: None,
211         },
212         fixes: [],
213     },
214     MappedRustDiagnostic {
215         url: Url {
216             scheme: "file",
217             cannot_be_a_base: false,
218             username: "",
219             password: None,
220             host: None,
221             port: None,
222             path: "/test/compiler/mir/tagset.rs",
223             query: None,
224             fragment: None,
225         },
226         diagnostic: Diagnostic {
227             range: Range {
228                 start: Position {
229                     line: 41,
230                     character: 23,
231                 },
232                 end: Position {
233                     line: 41,
234                     character: 28,
235                 },
236             },
237             severity: Some(
238                 DiagnosticSeverity(
239                     4,
240                 ),
241             ),
242             code: Some(
243                 String(
244                     "trivially_copy_pass_by_ref",
245                 ),
246             ),
247             code_description: Some(
248                 CodeDescription {
249                     href: Url {
250                         scheme: "https",
251                         cannot_be_a_base: false,
252                         username: "",
253                         password: None,
254                         host: Some(
255                             Domain(
256                                 "rust-lang.github.io",
257                             ),
258                         ),
259                         port: None,
260                         path: "/rust-clippy/master/index.html",
261                         query: None,
262                         fragment: Some(
263                             "trivially_copy_pass_by_ref",
264                         ),
265                     },
266                 },
267             ),
268             source: Some(
269                 "clippy",
270             ),
271             message: "consider passing by value instead: `self`",
272             related_information: Some(
273                 [
274                     DiagnosticRelatedInformation {
275                         location: Location {
276                             uri: Url {
277                                 scheme: "file",
278                                 cannot_be_a_base: false,
279                                 username: "",
280                                 password: None,
281                                 host: None,
282                                 port: None,
283                                 path: "/test/compiler/mir/tagset.rs",
284                                 query: None,
285                                 fragment: None,
286                             },
287                             range: Range {
288                                 start: Position {
289                                     line: 41,
290                                     character: 23,
291                                 },
292                                 end: Position {
293                                     line: 41,
294                                     character: 28,
295                                 },
296                             },
297                         },
298                         message: "original diagnostic",
299                     },
300                 ],
301             ),
302             tags: None,
303             data: None,
304         },
305         fixes: [
306             CodeAction {
307                 title: "consider passing by value instead: `self`",
308                 group: None,
309                 kind: Some(
310                     CodeActionKind(
311                         "quickfix",
312                     ),
313                 ),
314                 edit: Some(
315                     SnippetWorkspaceEdit {
316                         changes: Some(
317                             {
318                                 Url {
319                                     scheme: "file",
320                                     cannot_be_a_base: false,
321                                     username: "",
322                                     password: None,
323                                     host: None,
324                                     port: None,
325                                     path: "/test/compiler/mir/tagset.rs",
326                                     query: None,
327                                     fragment: None,
328                                 }: [
329                                     TextEdit {
330                                         range: Range {
331                                             start: Position {
332                                                 line: 41,
333                                                 character: 23,
334                                             },
335                                             end: Position {
336                                                 line: 41,
337                                                 character: 28,
338                                             },
339                                         },
340                                         new_text: "self",
341                                     },
342                                 ],
343                             },
344                         ),
345                         document_changes: None,
346                         change_annotations: None,
347                     },
348                 ),
349                 is_preferred: Some(
350                     true,
351                 ),
352                 data: None,
353             },
354         ],
355     },
356 ]