]>
Commit | Line | Data |
---|---|---|
a945c346 | 1 | // Copyright (C) 2020-2024 Free Software Foundation, Inc. |
2e7fc878 AC |
2 | |
3 | // This file is part of GCC. | |
4 | ||
5 | // GCC is free software; you can redistribute it and/or modify it under | |
6 | // the terms of the GNU General Public License as published by the Free | |
7 | // Software Foundation; either version 3, or (at your option) any later | |
8 | // version. | |
9 | ||
10 | // GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 | // for more details. | |
14 | ||
15 | // You should have received a copy of the GNU General Public License | |
16 | // along with GCC; see the file COPYING3. If not see | |
17 | // <http://www.gnu.org/licenses/>. | |
18 | ||
19 | #include "rust-system.h" | |
20 | #include "rust-attributes.h" | |
21 | #include "rust-ast.h" | |
22 | #include "rust-ast-full.h" | |
23 | #include "rust-diagnostics.h" | |
24 | ||
25 | namespace Rust { | |
26 | namespace Analysis { | |
27 | ||
28 | // https://doc.rust-lang.org/stable/nightly-rustc/src/rustc_feature/builtin_attrs.rs.html#248 | |
3a3a3520 AC |
29 | static const BuiltinAttrDefinition __definitions[] |
30 | = {{"inline", CODE_GENERATION}, | |
31 | {"cold", CODE_GENERATION}, | |
32 | {"cfg", EXPANSION}, | |
33 | {"cfg_attr", EXPANSION}, | |
34 | {"deprecated", STATIC_ANALYSIS}, | |
35 | {"allow", STATIC_ANALYSIS}, | |
36 | {"doc", HIR_LOWERING}, | |
37 | {"must_use", STATIC_ANALYSIS}, | |
38 | {"lang", HIR_LOWERING}, | |
39 | {"link_section", CODE_GENERATION}, | |
40 | {"no_mangle", CODE_GENERATION}, | |
41 | {"repr", CODE_GENERATION}, | |
42 | {"path", EXPANSION}, | |
739d0509 | 43 | {"macro_use", NAME_RESOLUTION}, |
776ff053 P |
44 | // FIXME: This is not implemented yet, see |
45 | // https://github.com/Rust-GCC/gccrs/issues/1475 | |
46 | {"target_feature", CODE_GENERATION}, | |
3a3a3520 AC |
47 | // From now on, these are reserved by the compiler and gated through |
48 | // #![feature(rustc_attrs)] | |
49 | {"rustc_inherit_overflow_checks", CODE_GENERATION}}; | |
2e7fc878 AC |
50 | |
51 | BuiltinAttributeMappings * | |
52 | BuiltinAttributeMappings::get () | |
53 | { | |
54 | static BuiltinAttributeMappings *instance = nullptr; | |
55 | if (instance == nullptr) | |
56 | instance = new BuiltinAttributeMappings (); | |
57 | ||
58 | return instance; | |
59 | } | |
60 | ||
61 | const BuiltinAttrDefinition & | |
62 | BuiltinAttributeMappings::lookup_builtin (const std::string &attr_name) const | |
63 | { | |
64 | auto it = mappings.find (attr_name); | |
65 | if (it == mappings.end ()) | |
66 | return BuiltinAttrDefinition::error_node (); | |
67 | ||
68 | return it->second; | |
69 | } | |
70 | ||
71 | BuiltinAttributeMappings::BuiltinAttributeMappings () | |
72 | { | |
73 | size_t ndefinitions = sizeof (__definitions) / sizeof (BuiltinAttrDefinition); | |
74 | for (size_t i = 0; i < ndefinitions; i++) | |
75 | { | |
76 | const BuiltinAttrDefinition &def = __definitions[i]; | |
77 | mappings.insert ({def.name, def}); | |
78 | } | |
79 | } | |
80 | ||
81 | AttributeChecker::AttributeChecker () {} | |
82 | ||
83 | void | |
84 | AttributeChecker::go (AST::Crate &crate) | |
85 | { | |
86 | check_attributes (crate.get_inner_attrs ()); | |
87 | ||
88 | for (auto &item : crate.items) | |
89 | item->accept_vis (*this); | |
90 | } | |
91 | ||
92 | static bool | |
93 | is_builtin (const AST::Attribute &attribute, BuiltinAttrDefinition &builtin) | |
94 | { | |
95 | auto &segments = attribute.get_path ().get_segments (); | |
96 | ||
97 | // Builtin attributes always have a single segment. This avoids us creating | |
98 | // strings all over the place and performing a linear search in the builtins | |
99 | // map | |
100 | if (segments.size () != 1) | |
101 | return false; | |
102 | ||
103 | builtin = BuiltinAttributeMappings::get ()->lookup_builtin ( | |
104 | segments.at (0).get_segment_name ()); | |
105 | ||
106 | return !builtin.is_error (); | |
107 | } | |
108 | ||
109 | /** | |
110 | * Check that the string given to #[doc(alias = ...)] or #[doc(alias(...))] is | |
111 | * valid. | |
112 | * | |
113 | * This means no whitespace characters other than spaces and no quoting | |
114 | * characters. | |
115 | */ | |
116 | static void | |
117 | check_doc_alias (const std::string &alias_input, const Location &locus) | |
118 | { | |
119 | // FIXME: The locus here is for the whole attribute. Can we get the locus | |
120 | // of the alias input instead? | |
121 | for (auto c : alias_input) | |
122 | if ((ISSPACE (c) && c != ' ') || c == '\'' || c == '\"') | |
123 | { | |
124 | auto to_print = std::string (1, c); | |
125 | switch (c) | |
126 | { | |
127 | case '\n': | |
128 | to_print = "\\n"; | |
129 | break; | |
130 | case '\t': | |
131 | to_print = "\\t"; | |
132 | break; | |
133 | default: | |
134 | break; | |
135 | } | |
136 | rust_error_at (locus, | |
137 | "invalid character used in %<#[doc(alias)]%> input: %qs", | |
138 | to_print.c_str ()); | |
139 | } | |
140 | ||
141 | if (alias_input.empty ()) | |
142 | return; | |
143 | ||
144 | if (alias_input.front () == ' ' || alias_input.back () == ' ') | |
145 | rust_error_at (locus, | |
146 | "%<#[doc(alias)]%> input cannot start or end with a space"); | |
147 | } | |
148 | ||
149 | static void | |
150 | check_doc_attribute (const AST::Attribute &attribute) | |
151 | { | |
152 | if (!attribute.has_attr_input ()) | |
153 | { | |
154 | rust_error_at ( | |
155 | attribute.get_locus (), | |
156 | // FIXME: Improve error message here. Rustc has a very good one | |
157 | "%<#[doc]%> cannot be an empty attribute"); | |
158 | return; | |
159 | } | |
160 | ||
161 | switch (attribute.get_attr_input ().get_attr_input_type ()) | |
162 | { | |
163 | case AST::AttrInput::LITERAL: | |
164 | case AST::AttrInput::META_ITEM: | |
165 | break; | |
166 | // FIXME: Handle them as well | |
167 | ||
168 | case AST::AttrInput::TOKEN_TREE: { | |
169 | // FIXME: This doesn't check for #[doc(alias(...))] | |
170 | const auto &option = static_cast<const AST::DelimTokenTree &> ( | |
171 | attribute.get_attr_input ()); | |
172 | auto *meta_item = option.parse_to_meta_item (); | |
173 | ||
174 | for (auto &item : meta_item->get_items ()) | |
175 | { | |
176 | if (item->is_key_value_pair ()) | |
177 | { | |
178 | auto name_value | |
179 | = static_cast<AST::MetaNameValueStr *> (item.get ()) | |
180 | ->get_name_value_pair (); | |
181 | ||
182 | // FIXME: Check for other stuff than #[doc(alias = ...)] | |
183 | if (name_value.first == "alias") | |
184 | check_doc_alias (name_value.second, attribute.get_locus ()); | |
185 | } | |
186 | } | |
187 | break; | |
188 | } | |
189 | } | |
190 | } | |
191 | ||
192 | void | |
193 | AttributeChecker::check_attribute (const AST::Attribute &attribute) | |
194 | { | |
195 | BuiltinAttrDefinition result; | |
196 | ||
197 | // This checker does not check non-builtin attributes | |
198 | if (!is_builtin (attribute, result)) | |
199 | return; | |
200 | ||
201 | // TODO: Add checks here for each builtin attribute | |
202 | // TODO: Have an enum of builtins as well, switching on strings is annoying | |
203 | // and costly | |
204 | if (result.name == "doc") | |
205 | check_doc_attribute (attribute); | |
206 | } | |
207 | ||
208 | void | |
209 | AttributeChecker::check_attributes (const AST::AttrVec &attributes) | |
210 | { | |
211 | for (auto &attr : attributes) | |
212 | check_attribute (attr); | |
213 | } | |
214 | ||
215 | void | |
9f455ed8 | 216 | AttributeChecker::visit (AST::Token &) |
2e7fc878 AC |
217 | {} |
218 | ||
219 | void | |
9f455ed8 | 220 | AttributeChecker::visit (AST::DelimTokenTree &) |
2e7fc878 AC |
221 | {} |
222 | ||
223 | void | |
9f455ed8 | 224 | AttributeChecker::visit (AST::AttrInputMetaItemContainer &) |
2e7fc878 AC |
225 | {} |
226 | ||
227 | void | |
9f455ed8 | 228 | AttributeChecker::visit (AST::IdentifierExpr &) |
2e7fc878 AC |
229 | {} |
230 | ||
231 | void | |
9f455ed8 | 232 | AttributeChecker::visit (AST::Lifetime &) |
2e7fc878 AC |
233 | {} |
234 | ||
235 | void | |
9f455ed8 | 236 | AttributeChecker::visit (AST::LifetimeParam &) |
2e7fc878 AC |
237 | {} |
238 | ||
239 | void | |
9f455ed8 | 240 | AttributeChecker::visit (AST::ConstGenericParam &) |
2e7fc878 AC |
241 | {} |
242 | ||
243 | // rust-path.h | |
244 | void | |
9f455ed8 | 245 | AttributeChecker::visit (AST::PathInExpression &) |
2e7fc878 AC |
246 | {} |
247 | ||
248 | void | |
9f455ed8 | 249 | AttributeChecker::visit (AST::TypePathSegment &) |
2e7fc878 AC |
250 | {} |
251 | ||
252 | void | |
9f455ed8 | 253 | AttributeChecker::visit (AST::TypePathSegmentGeneric &) |
2e7fc878 AC |
254 | {} |
255 | ||
256 | void | |
9f455ed8 | 257 | AttributeChecker::visit (AST::TypePathSegmentFunction &) |
2e7fc878 AC |
258 | {} |
259 | ||
260 | void | |
9f455ed8 | 261 | AttributeChecker::visit (AST::TypePath &) |
2e7fc878 AC |
262 | {} |
263 | ||
264 | void | |
9f455ed8 | 265 | AttributeChecker::visit (AST::QualifiedPathInExpression &) |
2e7fc878 AC |
266 | {} |
267 | ||
268 | void | |
9f455ed8 | 269 | AttributeChecker::visit (AST::QualifiedPathInType &) |
2e7fc878 AC |
270 | {} |
271 | ||
272 | // rust-expr.h | |
273 | void | |
9f455ed8 | 274 | AttributeChecker::visit (AST::LiteralExpr &) |
2e7fc878 AC |
275 | {} |
276 | ||
277 | void | |
9f455ed8 | 278 | AttributeChecker::visit (AST::AttrInputLiteral &) |
2e7fc878 AC |
279 | {} |
280 | ||
281 | void | |
9f455ed8 | 282 | AttributeChecker::visit (AST::MetaItemLitExpr &) |
2e7fc878 AC |
283 | {} |
284 | ||
285 | void | |
9f455ed8 | 286 | AttributeChecker::visit (AST::MetaItemPathLit &) |
2e7fc878 AC |
287 | {} |
288 | ||
289 | void | |
9f455ed8 | 290 | AttributeChecker::visit (AST::BorrowExpr &) |
2e7fc878 AC |
291 | {} |
292 | ||
293 | void | |
9f455ed8 | 294 | AttributeChecker::visit (AST::DereferenceExpr &) |
2e7fc878 AC |
295 | {} |
296 | ||
297 | void | |
9f455ed8 | 298 | AttributeChecker::visit (AST::ErrorPropagationExpr &) |
2e7fc878 AC |
299 | {} |
300 | ||
301 | void | |
9f455ed8 | 302 | AttributeChecker::visit (AST::NegationExpr &) |
2e7fc878 AC |
303 | {} |
304 | ||
305 | void | |
9f455ed8 | 306 | AttributeChecker::visit (AST::ArithmeticOrLogicalExpr &) |
2e7fc878 AC |
307 | {} |
308 | ||
309 | void | |
9f455ed8 | 310 | AttributeChecker::visit (AST::ComparisonExpr &) |
2e7fc878 AC |
311 | {} |
312 | ||
313 | void | |
9f455ed8 | 314 | AttributeChecker::visit (AST::LazyBooleanExpr &) |
2e7fc878 AC |
315 | {} |
316 | ||
317 | void | |
9f455ed8 | 318 | AttributeChecker::visit (AST::TypeCastExpr &) |
2e7fc878 AC |
319 | {} |
320 | ||
321 | void | |
9f455ed8 | 322 | AttributeChecker::visit (AST::AssignmentExpr &) |
2e7fc878 AC |
323 | {} |
324 | ||
325 | void | |
9f455ed8 | 326 | AttributeChecker::visit (AST::CompoundAssignmentExpr &) |
2e7fc878 AC |
327 | {} |
328 | ||
329 | void | |
9f455ed8 | 330 | AttributeChecker::visit (AST::GroupedExpr &) |
2e7fc878 AC |
331 | {} |
332 | ||
333 | void | |
9f455ed8 | 334 | AttributeChecker::visit (AST::ArrayElemsValues &) |
2e7fc878 AC |
335 | {} |
336 | ||
337 | void | |
9f455ed8 | 338 | AttributeChecker::visit (AST::ArrayElemsCopied &) |
2e7fc878 AC |
339 | {} |
340 | ||
341 | void | |
9f455ed8 | 342 | AttributeChecker::visit (AST::ArrayExpr &) |
2e7fc878 AC |
343 | {} |
344 | ||
345 | void | |
9f455ed8 | 346 | AttributeChecker::visit (AST::ArrayIndexExpr &) |
2e7fc878 AC |
347 | {} |
348 | ||
349 | void | |
9f455ed8 | 350 | AttributeChecker::visit (AST::TupleExpr &) |
2e7fc878 AC |
351 | {} |
352 | ||
353 | void | |
9f455ed8 | 354 | AttributeChecker::visit (AST::TupleIndexExpr &) |
2e7fc878 AC |
355 | {} |
356 | ||
357 | void | |
9f455ed8 | 358 | AttributeChecker::visit (AST::StructExprStruct &) |
2e7fc878 AC |
359 | {} |
360 | ||
361 | void | |
9f455ed8 | 362 | AttributeChecker::visit (AST::StructExprFieldIdentifier &) |
2e7fc878 AC |
363 | {} |
364 | ||
365 | void | |
9f455ed8 | 366 | AttributeChecker::visit (AST::StructExprFieldIdentifierValue &) |
2e7fc878 AC |
367 | {} |
368 | ||
369 | void | |
9f455ed8 | 370 | AttributeChecker::visit (AST::StructExprFieldIndexValue &) |
2e7fc878 AC |
371 | {} |
372 | ||
373 | void | |
9f455ed8 | 374 | AttributeChecker::visit (AST::StructExprStructFields &) |
2e7fc878 AC |
375 | {} |
376 | ||
377 | void | |
9f455ed8 | 378 | AttributeChecker::visit (AST::StructExprStructBase &) |
2e7fc878 AC |
379 | {} |
380 | ||
381 | void | |
9f455ed8 | 382 | AttributeChecker::visit (AST::CallExpr &) |
2e7fc878 AC |
383 | {} |
384 | ||
385 | void | |
9f455ed8 | 386 | AttributeChecker::visit (AST::MethodCallExpr &) |
2e7fc878 AC |
387 | {} |
388 | ||
389 | void | |
9f455ed8 | 390 | AttributeChecker::visit (AST::FieldAccessExpr &) |
2e7fc878 AC |
391 | {} |
392 | ||
393 | void | |
9f455ed8 | 394 | AttributeChecker::visit (AST::ClosureExprInner &) |
2e7fc878 AC |
395 | {} |
396 | ||
397 | void | |
9f455ed8 | 398 | AttributeChecker::visit (AST::BlockExpr &) |
2e7fc878 AC |
399 | {} |
400 | ||
401 | void | |
9f455ed8 | 402 | AttributeChecker::visit (AST::ClosureExprInnerTyped &) |
2e7fc878 AC |
403 | {} |
404 | ||
405 | void | |
9f455ed8 | 406 | AttributeChecker::visit (AST::ContinueExpr &) |
2e7fc878 AC |
407 | {} |
408 | ||
409 | void | |
9f455ed8 | 410 | AttributeChecker::visit (AST::BreakExpr &) |
2e7fc878 AC |
411 | {} |
412 | ||
413 | void | |
9f455ed8 | 414 | AttributeChecker::visit (AST::RangeFromToExpr &) |
2e7fc878 AC |
415 | {} |
416 | ||
417 | void | |
9f455ed8 | 418 | AttributeChecker::visit (AST::RangeFromExpr &) |
2e7fc878 AC |
419 | {} |
420 | ||
421 | void | |
9f455ed8 | 422 | AttributeChecker::visit (AST::RangeToExpr &) |
2e7fc878 AC |
423 | {} |
424 | ||
425 | void | |
9f455ed8 | 426 | AttributeChecker::visit (AST::RangeFullExpr &) |
2e7fc878 AC |
427 | {} |
428 | ||
429 | void | |
9f455ed8 | 430 | AttributeChecker::visit (AST::RangeFromToInclExpr &) |
2e7fc878 AC |
431 | {} |
432 | ||
433 | void | |
9f455ed8 | 434 | AttributeChecker::visit (AST::RangeToInclExpr &) |
2e7fc878 AC |
435 | {} |
436 | ||
437 | void | |
9f455ed8 | 438 | AttributeChecker::visit (AST::ReturnExpr &) |
2e7fc878 AC |
439 | {} |
440 | ||
441 | void | |
9f455ed8 | 442 | AttributeChecker::visit (AST::UnsafeBlockExpr &) |
2e7fc878 AC |
443 | {} |
444 | ||
445 | void | |
9f455ed8 | 446 | AttributeChecker::visit (AST::LoopExpr &) |
2e7fc878 AC |
447 | {} |
448 | ||
449 | void | |
9f455ed8 | 450 | AttributeChecker::visit (AST::WhileLoopExpr &) |
2e7fc878 AC |
451 | {} |
452 | ||
453 | void | |
9f455ed8 | 454 | AttributeChecker::visit (AST::WhileLetLoopExpr &) |
2e7fc878 AC |
455 | {} |
456 | ||
457 | void | |
9f455ed8 | 458 | AttributeChecker::visit (AST::ForLoopExpr &) |
2e7fc878 AC |
459 | {} |
460 | ||
461 | void | |
9f455ed8 | 462 | AttributeChecker::visit (AST::IfExpr &) |
2e7fc878 AC |
463 | {} |
464 | ||
465 | void | |
9f455ed8 | 466 | AttributeChecker::visit (AST::IfExprConseqElse &) |
2e7fc878 AC |
467 | {} |
468 | ||
469 | void | |
9f455ed8 | 470 | AttributeChecker::visit (AST::IfExprConseqIf &) |
2e7fc878 AC |
471 | {} |
472 | ||
473 | void | |
9f455ed8 | 474 | AttributeChecker::visit (AST::IfExprConseqIfLet &) |
2e7fc878 AC |
475 | {} |
476 | ||
477 | void | |
9f455ed8 | 478 | AttributeChecker::visit (AST::IfLetExpr &) |
2e7fc878 AC |
479 | {} |
480 | ||
481 | void | |
9f455ed8 | 482 | AttributeChecker::visit (AST::IfLetExprConseqElse &) |
2e7fc878 AC |
483 | {} |
484 | ||
485 | void | |
9f455ed8 | 486 | AttributeChecker::visit (AST::IfLetExprConseqIf &) |
2e7fc878 AC |
487 | {} |
488 | ||
489 | void | |
9f455ed8 | 490 | AttributeChecker::visit (AST::IfLetExprConseqIfLet &) |
2e7fc878 AC |
491 | {} |
492 | ||
493 | void | |
9f455ed8 | 494 | AttributeChecker::visit (AST::MatchExpr &) |
2e7fc878 AC |
495 | {} |
496 | ||
497 | void | |
9f455ed8 | 498 | AttributeChecker::visit (AST::AwaitExpr &) |
2e7fc878 AC |
499 | {} |
500 | ||
501 | void | |
9f455ed8 | 502 | AttributeChecker::visit (AST::AsyncBlockExpr &) |
2e7fc878 AC |
503 | {} |
504 | ||
505 | // rust-item.h | |
506 | void | |
9f455ed8 | 507 | AttributeChecker::visit (AST::TypeParam &) |
2e7fc878 AC |
508 | {} |
509 | ||
510 | void | |
9f455ed8 | 511 | AttributeChecker::visit (AST::LifetimeWhereClauseItem &) |
2e7fc878 AC |
512 | {} |
513 | ||
514 | void | |
9f455ed8 | 515 | AttributeChecker::visit (AST::TypeBoundWhereClauseItem &) |
2e7fc878 AC |
516 | {} |
517 | ||
518 | void | |
9f455ed8 | 519 | AttributeChecker::visit (AST::Method &) |
2e7fc878 AC |
520 | {} |
521 | ||
522 | void | |
9f455ed8 | 523 | AttributeChecker::visit (AST::Module &) |
2e7fc878 AC |
524 | {} |
525 | ||
526 | void | |
9f455ed8 | 527 | AttributeChecker::visit (AST::ExternCrate &) |
2e7fc878 AC |
528 | {} |
529 | ||
530 | void | |
9f455ed8 | 531 | AttributeChecker::visit (AST::UseTreeGlob &) |
2e7fc878 AC |
532 | {} |
533 | ||
534 | void | |
9f455ed8 | 535 | AttributeChecker::visit (AST::UseTreeList &) |
2e7fc878 AC |
536 | {} |
537 | ||
538 | void | |
9f455ed8 | 539 | AttributeChecker::visit (AST::UseTreeRebind &) |
2e7fc878 AC |
540 | {} |
541 | ||
542 | void | |
9f455ed8 | 543 | AttributeChecker::visit (AST::UseDeclaration &) |
2e7fc878 AC |
544 | {} |
545 | ||
546 | void | |
9f455ed8 | 547 | AttributeChecker::visit (AST::Function &) |
2e7fc878 AC |
548 | {} |
549 | ||
550 | void | |
9f455ed8 | 551 | AttributeChecker::visit (AST::TypeAlias &) |
2e7fc878 AC |
552 | {} |
553 | ||
554 | void | |
555 | AttributeChecker::visit (AST::StructStruct &struct_item) | |
556 | { | |
557 | check_attributes (struct_item.get_outer_attrs ()); | |
558 | } | |
559 | ||
560 | void | |
9f455ed8 | 561 | AttributeChecker::visit (AST::TupleStruct &) |
2e7fc878 AC |
562 | {} |
563 | ||
564 | void | |
9f455ed8 | 565 | AttributeChecker::visit (AST::EnumItem &) |
2e7fc878 AC |
566 | {} |
567 | ||
568 | void | |
9f455ed8 | 569 | AttributeChecker::visit (AST::EnumItemTuple &) |
2e7fc878 AC |
570 | {} |
571 | ||
572 | void | |
9f455ed8 | 573 | AttributeChecker::visit (AST::EnumItemStruct &) |
2e7fc878 AC |
574 | {} |
575 | ||
576 | void | |
9f455ed8 | 577 | AttributeChecker::visit (AST::EnumItemDiscriminant &) |
2e7fc878 AC |
578 | {} |
579 | ||
580 | void | |
9f455ed8 | 581 | AttributeChecker::visit (AST::Enum &) |
2e7fc878 AC |
582 | {} |
583 | ||
584 | void | |
9f455ed8 | 585 | AttributeChecker::visit (AST::Union &) |
2e7fc878 AC |
586 | {} |
587 | ||
588 | void | |
9f455ed8 | 589 | AttributeChecker::visit (AST::ConstantItem &) |
2e7fc878 AC |
590 | {} |
591 | ||
592 | void | |
9f455ed8 | 593 | AttributeChecker::visit (AST::StaticItem &) |
2e7fc878 AC |
594 | {} |
595 | ||
596 | void | |
9f455ed8 | 597 | AttributeChecker::visit (AST::TraitItemFunc &) |
2e7fc878 AC |
598 | {} |
599 | ||
600 | void | |
9f455ed8 | 601 | AttributeChecker::visit (AST::TraitItemMethod &) |
2e7fc878 AC |
602 | {} |
603 | ||
604 | void | |
9f455ed8 | 605 | AttributeChecker::visit (AST::TraitItemConst &) |
2e7fc878 AC |
606 | {} |
607 | ||
608 | void | |
9f455ed8 | 609 | AttributeChecker::visit (AST::TraitItemType &) |
2e7fc878 AC |
610 | {} |
611 | ||
612 | void | |
9f455ed8 | 613 | AttributeChecker::visit (AST::Trait &) |
2e7fc878 AC |
614 | {} |
615 | ||
616 | void | |
9f455ed8 | 617 | AttributeChecker::visit (AST::InherentImpl &) |
2e7fc878 AC |
618 | {} |
619 | ||
620 | void | |
9f455ed8 | 621 | AttributeChecker::visit (AST::TraitImpl &) |
2e7fc878 AC |
622 | {} |
623 | ||
624 | void | |
9f455ed8 | 625 | AttributeChecker::visit (AST::ExternalStaticItem &) |
2e7fc878 AC |
626 | {} |
627 | ||
628 | void | |
9f455ed8 | 629 | AttributeChecker::visit (AST::ExternalFunctionItem &) |
2e7fc878 AC |
630 | {} |
631 | ||
632 | void | |
9f455ed8 | 633 | AttributeChecker::visit (AST::ExternBlock &) |
2e7fc878 AC |
634 | {} |
635 | ||
636 | // rust-macro.h | |
637 | void | |
9f455ed8 | 638 | AttributeChecker::visit (AST::MacroMatchFragment &) |
2e7fc878 AC |
639 | {} |
640 | ||
641 | void | |
9f455ed8 | 642 | AttributeChecker::visit (AST::MacroMatchRepetition &) |
2e7fc878 AC |
643 | {} |
644 | ||
645 | void | |
9f455ed8 | 646 | AttributeChecker::visit (AST::MacroMatcher &) |
2e7fc878 AC |
647 | {} |
648 | ||
649 | void | |
9f455ed8 | 650 | AttributeChecker::visit (AST::MacroRulesDefinition &) |
2e7fc878 AC |
651 | {} |
652 | ||
653 | void | |
9f455ed8 | 654 | AttributeChecker::visit (AST::MacroInvocation &) |
2e7fc878 AC |
655 | {} |
656 | ||
657 | void | |
9f455ed8 | 658 | AttributeChecker::visit (AST::MetaItemPath &) |
2e7fc878 AC |
659 | {} |
660 | ||
661 | void | |
9f455ed8 | 662 | AttributeChecker::visit (AST::MetaItemSeq &) |
2e7fc878 AC |
663 | {} |
664 | ||
665 | void | |
9f455ed8 | 666 | AttributeChecker::visit (AST::MetaWord &) |
2e7fc878 AC |
667 | {} |
668 | ||
669 | void | |
9f455ed8 | 670 | AttributeChecker::visit (AST::MetaNameValueStr &) |
2e7fc878 AC |
671 | {} |
672 | ||
673 | void | |
9f455ed8 | 674 | AttributeChecker::visit (AST::MetaListPaths &) |
2e7fc878 AC |
675 | {} |
676 | ||
677 | void | |
9f455ed8 | 678 | AttributeChecker::visit (AST::MetaListNameValueStr &) |
2e7fc878 AC |
679 | {} |
680 | ||
681 | // rust-pattern.h | |
682 | void | |
9f455ed8 | 683 | AttributeChecker::visit (AST::LiteralPattern &) |
2e7fc878 AC |
684 | {} |
685 | ||
686 | void | |
9f455ed8 | 687 | AttributeChecker::visit (AST::IdentifierPattern &) |
2e7fc878 AC |
688 | {} |
689 | ||
690 | void | |
9f455ed8 | 691 | AttributeChecker::visit (AST::WildcardPattern &) |
2e7fc878 AC |
692 | {} |
693 | ||
9f455ed8 | 694 | // void AttributeChecker::visit(RangePatternBound& ){} |
2e7fc878 AC |
695 | |
696 | void | |
9f455ed8 | 697 | AttributeChecker::visit (AST::RangePatternBoundLiteral &) |
2e7fc878 AC |
698 | {} |
699 | ||
700 | void | |
9f455ed8 | 701 | AttributeChecker::visit (AST::RangePatternBoundPath &) |
2e7fc878 AC |
702 | {} |
703 | ||
704 | void | |
9f455ed8 | 705 | AttributeChecker::visit (AST::RangePatternBoundQualPath &) |
2e7fc878 AC |
706 | {} |
707 | ||
708 | void | |
9f455ed8 | 709 | AttributeChecker::visit (AST::RangePattern &) |
2e7fc878 AC |
710 | {} |
711 | ||
712 | void | |
9f455ed8 | 713 | AttributeChecker::visit (AST::ReferencePattern &) |
2e7fc878 AC |
714 | {} |
715 | ||
9f455ed8 | 716 | // void AttributeChecker::visit(StructPatternField& ){} |
2e7fc878 AC |
717 | |
718 | void | |
9f455ed8 | 719 | AttributeChecker::visit (AST::StructPatternFieldTuplePat &) |
2e7fc878 AC |
720 | {} |
721 | ||
722 | void | |
9f455ed8 | 723 | AttributeChecker::visit (AST::StructPatternFieldIdentPat &) |
2e7fc878 AC |
724 | {} |
725 | ||
726 | void | |
9f455ed8 | 727 | AttributeChecker::visit (AST::StructPatternFieldIdent &) |
2e7fc878 AC |
728 | {} |
729 | ||
730 | void | |
9f455ed8 | 731 | AttributeChecker::visit (AST::StructPattern &) |
2e7fc878 AC |
732 | {} |
733 | ||
9f455ed8 | 734 | // void AttributeChecker::visit(TupleStructItems& ){} |
2e7fc878 AC |
735 | |
736 | void | |
9f455ed8 | 737 | AttributeChecker::visit (AST::TupleStructItemsNoRange &) |
2e7fc878 AC |
738 | {} |
739 | ||
740 | void | |
9f455ed8 | 741 | AttributeChecker::visit (AST::TupleStructItemsRange &) |
2e7fc878 AC |
742 | {} |
743 | ||
744 | void | |
9f455ed8 | 745 | AttributeChecker::visit (AST::TupleStructPattern &) |
2e7fc878 AC |
746 | {} |
747 | ||
9f455ed8 | 748 | // void AttributeChecker::visit(TuplePatternItems& ){} |
2e7fc878 AC |
749 | |
750 | void | |
9f455ed8 | 751 | AttributeChecker::visit (AST::TuplePatternItemsMultiple &) |
2e7fc878 AC |
752 | {} |
753 | ||
754 | void | |
9f455ed8 | 755 | AttributeChecker::visit (AST::TuplePatternItemsRanged &) |
2e7fc878 AC |
756 | {} |
757 | ||
758 | void | |
9f455ed8 | 759 | AttributeChecker::visit (AST::TuplePattern &) |
2e7fc878 AC |
760 | {} |
761 | ||
762 | void | |
9f455ed8 | 763 | AttributeChecker::visit (AST::GroupedPattern &) |
2e7fc878 AC |
764 | {} |
765 | ||
766 | void | |
9f455ed8 | 767 | AttributeChecker::visit (AST::SlicePattern &) |
2e7fc878 AC |
768 | {} |
769 | ||
8628486f OA |
770 | void |
771 | AttributeChecker::visit (AST::AltPattern &) | |
772 | {} | |
773 | ||
2e7fc878 AC |
774 | // rust-stmt.h |
775 | void | |
9f455ed8 | 776 | AttributeChecker::visit (AST::EmptyStmt &) |
2e7fc878 AC |
777 | {} |
778 | ||
779 | void | |
9f455ed8 | 780 | AttributeChecker::visit (AST::LetStmt &) |
2e7fc878 AC |
781 | {} |
782 | ||
783 | void | |
9f455ed8 | 784 | AttributeChecker::visit (AST::ExprStmtWithoutBlock &) |
2e7fc878 AC |
785 | {} |
786 | ||
787 | void | |
9f455ed8 | 788 | AttributeChecker::visit (AST::ExprStmtWithBlock &) |
2e7fc878 AC |
789 | {} |
790 | ||
791 | // rust-type.h | |
792 | void | |
9f455ed8 | 793 | AttributeChecker::visit (AST::TraitBound &) |
2e7fc878 AC |
794 | {} |
795 | ||
796 | void | |
9f455ed8 | 797 | AttributeChecker::visit (AST::ImplTraitType &) |
2e7fc878 AC |
798 | {} |
799 | ||
800 | void | |
9f455ed8 | 801 | AttributeChecker::visit (AST::TraitObjectType &) |
2e7fc878 AC |
802 | {} |
803 | ||
804 | void | |
9f455ed8 | 805 | AttributeChecker::visit (AST::ParenthesisedType &) |
2e7fc878 AC |
806 | {} |
807 | ||
808 | void | |
9f455ed8 | 809 | AttributeChecker::visit (AST::ImplTraitTypeOneBound &) |
2e7fc878 AC |
810 | {} |
811 | ||
812 | void | |
9f455ed8 | 813 | AttributeChecker::visit (AST::TraitObjectTypeOneBound &) |
2e7fc878 AC |
814 | {} |
815 | ||
816 | void | |
9f455ed8 | 817 | AttributeChecker::visit (AST::TupleType &) |
2e7fc878 AC |
818 | {} |
819 | ||
820 | void | |
9f455ed8 | 821 | AttributeChecker::visit (AST::NeverType &) |
2e7fc878 AC |
822 | {} |
823 | ||
824 | void | |
9f455ed8 | 825 | AttributeChecker::visit (AST::RawPointerType &) |
2e7fc878 AC |
826 | {} |
827 | ||
828 | void | |
9f455ed8 | 829 | AttributeChecker::visit (AST::ReferenceType &) |
2e7fc878 AC |
830 | {} |
831 | ||
832 | void | |
9f455ed8 | 833 | AttributeChecker::visit (AST::ArrayType &) |
2e7fc878 AC |
834 | {} |
835 | ||
836 | void | |
9f455ed8 | 837 | AttributeChecker::visit (AST::SliceType &) |
2e7fc878 AC |
838 | {} |
839 | ||
840 | void | |
9f455ed8 | 841 | AttributeChecker::visit (AST::InferredType &) |
2e7fc878 AC |
842 | {} |
843 | ||
844 | void | |
9f455ed8 | 845 | AttributeChecker::visit (AST::BareFunctionType &) |
2e7fc878 AC |
846 | {} |
847 | ||
848 | } // namespace Analysis | |
849 | } // namespace Rust |