]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/rust/util/rust-attributes.cc
Update copyright years.
[thirdparty/gcc.git] / gcc / rust / util / rust-attributes.cc
CommitLineData
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
25namespace Rust {
26namespace Analysis {
27
28// https://doc.rust-lang.org/stable/nightly-rustc/src/rustc_feature/builtin_attrs.rs.html#248
3a3a3520
AC
29static 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
51BuiltinAttributeMappings *
52BuiltinAttributeMappings::get ()
53{
54 static BuiltinAttributeMappings *instance = nullptr;
55 if (instance == nullptr)
56 instance = new BuiltinAttributeMappings ();
57
58 return instance;
59}
60
61const BuiltinAttrDefinition &
62BuiltinAttributeMappings::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
71BuiltinAttributeMappings::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
81AttributeChecker::AttributeChecker () {}
82
83void
84AttributeChecker::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
92static bool
93is_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 */
116static void
117check_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
149static void
150check_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
192void
193AttributeChecker::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
208void
209AttributeChecker::check_attributes (const AST::AttrVec &attributes)
210{
211 for (auto &attr : attributes)
212 check_attribute (attr);
213}
214
215void
9f455ed8 216AttributeChecker::visit (AST::Token &)
2e7fc878
AC
217{}
218
219void
9f455ed8 220AttributeChecker::visit (AST::DelimTokenTree &)
2e7fc878
AC
221{}
222
223void
9f455ed8 224AttributeChecker::visit (AST::AttrInputMetaItemContainer &)
2e7fc878
AC
225{}
226
227void
9f455ed8 228AttributeChecker::visit (AST::IdentifierExpr &)
2e7fc878
AC
229{}
230
231void
9f455ed8 232AttributeChecker::visit (AST::Lifetime &)
2e7fc878
AC
233{}
234
235void
9f455ed8 236AttributeChecker::visit (AST::LifetimeParam &)
2e7fc878
AC
237{}
238
239void
9f455ed8 240AttributeChecker::visit (AST::ConstGenericParam &)
2e7fc878
AC
241{}
242
243// rust-path.h
244void
9f455ed8 245AttributeChecker::visit (AST::PathInExpression &)
2e7fc878
AC
246{}
247
248void
9f455ed8 249AttributeChecker::visit (AST::TypePathSegment &)
2e7fc878
AC
250{}
251
252void
9f455ed8 253AttributeChecker::visit (AST::TypePathSegmentGeneric &)
2e7fc878
AC
254{}
255
256void
9f455ed8 257AttributeChecker::visit (AST::TypePathSegmentFunction &)
2e7fc878
AC
258{}
259
260void
9f455ed8 261AttributeChecker::visit (AST::TypePath &)
2e7fc878
AC
262{}
263
264void
9f455ed8 265AttributeChecker::visit (AST::QualifiedPathInExpression &)
2e7fc878
AC
266{}
267
268void
9f455ed8 269AttributeChecker::visit (AST::QualifiedPathInType &)
2e7fc878
AC
270{}
271
272// rust-expr.h
273void
9f455ed8 274AttributeChecker::visit (AST::LiteralExpr &)
2e7fc878
AC
275{}
276
277void
9f455ed8 278AttributeChecker::visit (AST::AttrInputLiteral &)
2e7fc878
AC
279{}
280
281void
9f455ed8 282AttributeChecker::visit (AST::MetaItemLitExpr &)
2e7fc878
AC
283{}
284
285void
9f455ed8 286AttributeChecker::visit (AST::MetaItemPathLit &)
2e7fc878
AC
287{}
288
289void
9f455ed8 290AttributeChecker::visit (AST::BorrowExpr &)
2e7fc878
AC
291{}
292
293void
9f455ed8 294AttributeChecker::visit (AST::DereferenceExpr &)
2e7fc878
AC
295{}
296
297void
9f455ed8 298AttributeChecker::visit (AST::ErrorPropagationExpr &)
2e7fc878
AC
299{}
300
301void
9f455ed8 302AttributeChecker::visit (AST::NegationExpr &)
2e7fc878
AC
303{}
304
305void
9f455ed8 306AttributeChecker::visit (AST::ArithmeticOrLogicalExpr &)
2e7fc878
AC
307{}
308
309void
9f455ed8 310AttributeChecker::visit (AST::ComparisonExpr &)
2e7fc878
AC
311{}
312
313void
9f455ed8 314AttributeChecker::visit (AST::LazyBooleanExpr &)
2e7fc878
AC
315{}
316
317void
9f455ed8 318AttributeChecker::visit (AST::TypeCastExpr &)
2e7fc878
AC
319{}
320
321void
9f455ed8 322AttributeChecker::visit (AST::AssignmentExpr &)
2e7fc878
AC
323{}
324
325void
9f455ed8 326AttributeChecker::visit (AST::CompoundAssignmentExpr &)
2e7fc878
AC
327{}
328
329void
9f455ed8 330AttributeChecker::visit (AST::GroupedExpr &)
2e7fc878
AC
331{}
332
333void
9f455ed8 334AttributeChecker::visit (AST::ArrayElemsValues &)
2e7fc878
AC
335{}
336
337void
9f455ed8 338AttributeChecker::visit (AST::ArrayElemsCopied &)
2e7fc878
AC
339{}
340
341void
9f455ed8 342AttributeChecker::visit (AST::ArrayExpr &)
2e7fc878
AC
343{}
344
345void
9f455ed8 346AttributeChecker::visit (AST::ArrayIndexExpr &)
2e7fc878
AC
347{}
348
349void
9f455ed8 350AttributeChecker::visit (AST::TupleExpr &)
2e7fc878
AC
351{}
352
353void
9f455ed8 354AttributeChecker::visit (AST::TupleIndexExpr &)
2e7fc878
AC
355{}
356
357void
9f455ed8 358AttributeChecker::visit (AST::StructExprStruct &)
2e7fc878
AC
359{}
360
361void
9f455ed8 362AttributeChecker::visit (AST::StructExprFieldIdentifier &)
2e7fc878
AC
363{}
364
365void
9f455ed8 366AttributeChecker::visit (AST::StructExprFieldIdentifierValue &)
2e7fc878
AC
367{}
368
369void
9f455ed8 370AttributeChecker::visit (AST::StructExprFieldIndexValue &)
2e7fc878
AC
371{}
372
373void
9f455ed8 374AttributeChecker::visit (AST::StructExprStructFields &)
2e7fc878
AC
375{}
376
377void
9f455ed8 378AttributeChecker::visit (AST::StructExprStructBase &)
2e7fc878
AC
379{}
380
381void
9f455ed8 382AttributeChecker::visit (AST::CallExpr &)
2e7fc878
AC
383{}
384
385void
9f455ed8 386AttributeChecker::visit (AST::MethodCallExpr &)
2e7fc878
AC
387{}
388
389void
9f455ed8 390AttributeChecker::visit (AST::FieldAccessExpr &)
2e7fc878
AC
391{}
392
393void
9f455ed8 394AttributeChecker::visit (AST::ClosureExprInner &)
2e7fc878
AC
395{}
396
397void
9f455ed8 398AttributeChecker::visit (AST::BlockExpr &)
2e7fc878
AC
399{}
400
401void
9f455ed8 402AttributeChecker::visit (AST::ClosureExprInnerTyped &)
2e7fc878
AC
403{}
404
405void
9f455ed8 406AttributeChecker::visit (AST::ContinueExpr &)
2e7fc878
AC
407{}
408
409void
9f455ed8 410AttributeChecker::visit (AST::BreakExpr &)
2e7fc878
AC
411{}
412
413void
9f455ed8 414AttributeChecker::visit (AST::RangeFromToExpr &)
2e7fc878
AC
415{}
416
417void
9f455ed8 418AttributeChecker::visit (AST::RangeFromExpr &)
2e7fc878
AC
419{}
420
421void
9f455ed8 422AttributeChecker::visit (AST::RangeToExpr &)
2e7fc878
AC
423{}
424
425void
9f455ed8 426AttributeChecker::visit (AST::RangeFullExpr &)
2e7fc878
AC
427{}
428
429void
9f455ed8 430AttributeChecker::visit (AST::RangeFromToInclExpr &)
2e7fc878
AC
431{}
432
433void
9f455ed8 434AttributeChecker::visit (AST::RangeToInclExpr &)
2e7fc878
AC
435{}
436
437void
9f455ed8 438AttributeChecker::visit (AST::ReturnExpr &)
2e7fc878
AC
439{}
440
441void
9f455ed8 442AttributeChecker::visit (AST::UnsafeBlockExpr &)
2e7fc878
AC
443{}
444
445void
9f455ed8 446AttributeChecker::visit (AST::LoopExpr &)
2e7fc878
AC
447{}
448
449void
9f455ed8 450AttributeChecker::visit (AST::WhileLoopExpr &)
2e7fc878
AC
451{}
452
453void
9f455ed8 454AttributeChecker::visit (AST::WhileLetLoopExpr &)
2e7fc878
AC
455{}
456
457void
9f455ed8 458AttributeChecker::visit (AST::ForLoopExpr &)
2e7fc878
AC
459{}
460
461void
9f455ed8 462AttributeChecker::visit (AST::IfExpr &)
2e7fc878
AC
463{}
464
465void
9f455ed8 466AttributeChecker::visit (AST::IfExprConseqElse &)
2e7fc878
AC
467{}
468
469void
9f455ed8 470AttributeChecker::visit (AST::IfExprConseqIf &)
2e7fc878
AC
471{}
472
473void
9f455ed8 474AttributeChecker::visit (AST::IfExprConseqIfLet &)
2e7fc878
AC
475{}
476
477void
9f455ed8 478AttributeChecker::visit (AST::IfLetExpr &)
2e7fc878
AC
479{}
480
481void
9f455ed8 482AttributeChecker::visit (AST::IfLetExprConseqElse &)
2e7fc878
AC
483{}
484
485void
9f455ed8 486AttributeChecker::visit (AST::IfLetExprConseqIf &)
2e7fc878
AC
487{}
488
489void
9f455ed8 490AttributeChecker::visit (AST::IfLetExprConseqIfLet &)
2e7fc878
AC
491{}
492
493void
9f455ed8 494AttributeChecker::visit (AST::MatchExpr &)
2e7fc878
AC
495{}
496
497void
9f455ed8 498AttributeChecker::visit (AST::AwaitExpr &)
2e7fc878
AC
499{}
500
501void
9f455ed8 502AttributeChecker::visit (AST::AsyncBlockExpr &)
2e7fc878
AC
503{}
504
505// rust-item.h
506void
9f455ed8 507AttributeChecker::visit (AST::TypeParam &)
2e7fc878
AC
508{}
509
510void
9f455ed8 511AttributeChecker::visit (AST::LifetimeWhereClauseItem &)
2e7fc878
AC
512{}
513
514void
9f455ed8 515AttributeChecker::visit (AST::TypeBoundWhereClauseItem &)
2e7fc878
AC
516{}
517
518void
9f455ed8 519AttributeChecker::visit (AST::Method &)
2e7fc878
AC
520{}
521
522void
9f455ed8 523AttributeChecker::visit (AST::Module &)
2e7fc878
AC
524{}
525
526void
9f455ed8 527AttributeChecker::visit (AST::ExternCrate &)
2e7fc878
AC
528{}
529
530void
9f455ed8 531AttributeChecker::visit (AST::UseTreeGlob &)
2e7fc878
AC
532{}
533
534void
9f455ed8 535AttributeChecker::visit (AST::UseTreeList &)
2e7fc878
AC
536{}
537
538void
9f455ed8 539AttributeChecker::visit (AST::UseTreeRebind &)
2e7fc878
AC
540{}
541
542void
9f455ed8 543AttributeChecker::visit (AST::UseDeclaration &)
2e7fc878
AC
544{}
545
546void
9f455ed8 547AttributeChecker::visit (AST::Function &)
2e7fc878
AC
548{}
549
550void
9f455ed8 551AttributeChecker::visit (AST::TypeAlias &)
2e7fc878
AC
552{}
553
554void
555AttributeChecker::visit (AST::StructStruct &struct_item)
556{
557 check_attributes (struct_item.get_outer_attrs ());
558}
559
560void
9f455ed8 561AttributeChecker::visit (AST::TupleStruct &)
2e7fc878
AC
562{}
563
564void
9f455ed8 565AttributeChecker::visit (AST::EnumItem &)
2e7fc878
AC
566{}
567
568void
9f455ed8 569AttributeChecker::visit (AST::EnumItemTuple &)
2e7fc878
AC
570{}
571
572void
9f455ed8 573AttributeChecker::visit (AST::EnumItemStruct &)
2e7fc878
AC
574{}
575
576void
9f455ed8 577AttributeChecker::visit (AST::EnumItemDiscriminant &)
2e7fc878
AC
578{}
579
580void
9f455ed8 581AttributeChecker::visit (AST::Enum &)
2e7fc878
AC
582{}
583
584void
9f455ed8 585AttributeChecker::visit (AST::Union &)
2e7fc878
AC
586{}
587
588void
9f455ed8 589AttributeChecker::visit (AST::ConstantItem &)
2e7fc878
AC
590{}
591
592void
9f455ed8 593AttributeChecker::visit (AST::StaticItem &)
2e7fc878
AC
594{}
595
596void
9f455ed8 597AttributeChecker::visit (AST::TraitItemFunc &)
2e7fc878
AC
598{}
599
600void
9f455ed8 601AttributeChecker::visit (AST::TraitItemMethod &)
2e7fc878
AC
602{}
603
604void
9f455ed8 605AttributeChecker::visit (AST::TraitItemConst &)
2e7fc878
AC
606{}
607
608void
9f455ed8 609AttributeChecker::visit (AST::TraitItemType &)
2e7fc878
AC
610{}
611
612void
9f455ed8 613AttributeChecker::visit (AST::Trait &)
2e7fc878
AC
614{}
615
616void
9f455ed8 617AttributeChecker::visit (AST::InherentImpl &)
2e7fc878
AC
618{}
619
620void
9f455ed8 621AttributeChecker::visit (AST::TraitImpl &)
2e7fc878
AC
622{}
623
624void
9f455ed8 625AttributeChecker::visit (AST::ExternalStaticItem &)
2e7fc878
AC
626{}
627
628void
9f455ed8 629AttributeChecker::visit (AST::ExternalFunctionItem &)
2e7fc878
AC
630{}
631
632void
9f455ed8 633AttributeChecker::visit (AST::ExternBlock &)
2e7fc878
AC
634{}
635
636// rust-macro.h
637void
9f455ed8 638AttributeChecker::visit (AST::MacroMatchFragment &)
2e7fc878
AC
639{}
640
641void
9f455ed8 642AttributeChecker::visit (AST::MacroMatchRepetition &)
2e7fc878
AC
643{}
644
645void
9f455ed8 646AttributeChecker::visit (AST::MacroMatcher &)
2e7fc878
AC
647{}
648
649void
9f455ed8 650AttributeChecker::visit (AST::MacroRulesDefinition &)
2e7fc878
AC
651{}
652
653void
9f455ed8 654AttributeChecker::visit (AST::MacroInvocation &)
2e7fc878
AC
655{}
656
657void
9f455ed8 658AttributeChecker::visit (AST::MetaItemPath &)
2e7fc878
AC
659{}
660
661void
9f455ed8 662AttributeChecker::visit (AST::MetaItemSeq &)
2e7fc878
AC
663{}
664
665void
9f455ed8 666AttributeChecker::visit (AST::MetaWord &)
2e7fc878
AC
667{}
668
669void
9f455ed8 670AttributeChecker::visit (AST::MetaNameValueStr &)
2e7fc878
AC
671{}
672
673void
9f455ed8 674AttributeChecker::visit (AST::MetaListPaths &)
2e7fc878
AC
675{}
676
677void
9f455ed8 678AttributeChecker::visit (AST::MetaListNameValueStr &)
2e7fc878
AC
679{}
680
681// rust-pattern.h
682void
9f455ed8 683AttributeChecker::visit (AST::LiteralPattern &)
2e7fc878
AC
684{}
685
686void
9f455ed8 687AttributeChecker::visit (AST::IdentifierPattern &)
2e7fc878
AC
688{}
689
690void
9f455ed8 691AttributeChecker::visit (AST::WildcardPattern &)
2e7fc878
AC
692{}
693
9f455ed8 694// void AttributeChecker::visit(RangePatternBound& ){}
2e7fc878
AC
695
696void
9f455ed8 697AttributeChecker::visit (AST::RangePatternBoundLiteral &)
2e7fc878
AC
698{}
699
700void
9f455ed8 701AttributeChecker::visit (AST::RangePatternBoundPath &)
2e7fc878
AC
702{}
703
704void
9f455ed8 705AttributeChecker::visit (AST::RangePatternBoundQualPath &)
2e7fc878
AC
706{}
707
708void
9f455ed8 709AttributeChecker::visit (AST::RangePattern &)
2e7fc878
AC
710{}
711
712void
9f455ed8 713AttributeChecker::visit (AST::ReferencePattern &)
2e7fc878
AC
714{}
715
9f455ed8 716// void AttributeChecker::visit(StructPatternField& ){}
2e7fc878
AC
717
718void
9f455ed8 719AttributeChecker::visit (AST::StructPatternFieldTuplePat &)
2e7fc878
AC
720{}
721
722void
9f455ed8 723AttributeChecker::visit (AST::StructPatternFieldIdentPat &)
2e7fc878
AC
724{}
725
726void
9f455ed8 727AttributeChecker::visit (AST::StructPatternFieldIdent &)
2e7fc878
AC
728{}
729
730void
9f455ed8 731AttributeChecker::visit (AST::StructPattern &)
2e7fc878
AC
732{}
733
9f455ed8 734// void AttributeChecker::visit(TupleStructItems& ){}
2e7fc878
AC
735
736void
9f455ed8 737AttributeChecker::visit (AST::TupleStructItemsNoRange &)
2e7fc878
AC
738{}
739
740void
9f455ed8 741AttributeChecker::visit (AST::TupleStructItemsRange &)
2e7fc878
AC
742{}
743
744void
9f455ed8 745AttributeChecker::visit (AST::TupleStructPattern &)
2e7fc878
AC
746{}
747
9f455ed8 748// void AttributeChecker::visit(TuplePatternItems& ){}
2e7fc878
AC
749
750void
9f455ed8 751AttributeChecker::visit (AST::TuplePatternItemsMultiple &)
2e7fc878
AC
752{}
753
754void
9f455ed8 755AttributeChecker::visit (AST::TuplePatternItemsRanged &)
2e7fc878
AC
756{}
757
758void
9f455ed8 759AttributeChecker::visit (AST::TuplePattern &)
2e7fc878
AC
760{}
761
762void
9f455ed8 763AttributeChecker::visit (AST::GroupedPattern &)
2e7fc878
AC
764{}
765
766void
9f455ed8 767AttributeChecker::visit (AST::SlicePattern &)
2e7fc878
AC
768{}
769
8628486f
OA
770void
771AttributeChecker::visit (AST::AltPattern &)
772{}
773
2e7fc878
AC
774// rust-stmt.h
775void
9f455ed8 776AttributeChecker::visit (AST::EmptyStmt &)
2e7fc878
AC
777{}
778
779void
9f455ed8 780AttributeChecker::visit (AST::LetStmt &)
2e7fc878
AC
781{}
782
783void
9f455ed8 784AttributeChecker::visit (AST::ExprStmtWithoutBlock &)
2e7fc878
AC
785{}
786
787void
9f455ed8 788AttributeChecker::visit (AST::ExprStmtWithBlock &)
2e7fc878
AC
789{}
790
791// rust-type.h
792void
9f455ed8 793AttributeChecker::visit (AST::TraitBound &)
2e7fc878
AC
794{}
795
796void
9f455ed8 797AttributeChecker::visit (AST::ImplTraitType &)
2e7fc878
AC
798{}
799
800void
9f455ed8 801AttributeChecker::visit (AST::TraitObjectType &)
2e7fc878
AC
802{}
803
804void
9f455ed8 805AttributeChecker::visit (AST::ParenthesisedType &)
2e7fc878
AC
806{}
807
808void
9f455ed8 809AttributeChecker::visit (AST::ImplTraitTypeOneBound &)
2e7fc878
AC
810{}
811
812void
9f455ed8 813AttributeChecker::visit (AST::TraitObjectTypeOneBound &)
2e7fc878
AC
814{}
815
816void
9f455ed8 817AttributeChecker::visit (AST::TupleType &)
2e7fc878
AC
818{}
819
820void
9f455ed8 821AttributeChecker::visit (AST::NeverType &)
2e7fc878
AC
822{}
823
824void
9f455ed8 825AttributeChecker::visit (AST::RawPointerType &)
2e7fc878
AC
826{}
827
828void
9f455ed8 829AttributeChecker::visit (AST::ReferenceType &)
2e7fc878
AC
830{}
831
832void
9f455ed8 833AttributeChecker::visit (AST::ArrayType &)
2e7fc878
AC
834{}
835
836void
9f455ed8 837AttributeChecker::visit (AST::SliceType &)
2e7fc878
AC
838{}
839
840void
9f455ed8 841AttributeChecker::visit (AST::InferredType &)
2e7fc878
AC
842{}
843
844void
9f455ed8 845AttributeChecker::visit (AST::BareFunctionType &)
2e7fc878
AC
846{}
847
848} // namespace Analysis
849} // namespace Rust