1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Attributes, in both spellings.
//!
//! Design: `spec/06-lexer-and-parser.md` sections 6.6 and 6.7.
//!
//! C23's `[[deprecated]]` and GCC's `__attribute__((deprecated))` mean the same thing and are
//! written in different places, so the syntax each one was written in is kept on the node. The
//! placement rules differ between the two and GCC's are not always what its documentation says,
//! so a diagnostic about where an attribute may go has to know which spelling it is talking
//! about. Nothing here decides what an attribute *means*; that is `spec/13-gnu-extensions.md`
//! and it happens in semantic analysis.
use Symbol;
use Span;
use crateAttrArgList;
use crateExprId;
/// One attribute.
/// Which spelling an attribute was written in.
/// One argument of an attribute.
///
/// Most attribute arguments are expressions, but a few take a bare identifier that must not be
/// looked up as one: the `printf` in `format(printf, 1, 2)` names an archetype and the `DI` in
/// `mode(DI)` names a machine mode, and neither is a variable. Treating them as expressions is
/// how a compiler ends up reporting an undeclared identifier inside an attribute.