cairo_lang_syntax/attribute/consts.rs
1// Attributes which does not invoke any plugin, and thus are not declared in the plugin crate.
2
3/// An attribute that can be used to make the formatter ignore the formatting of a statement or an
4/// item, and keep the user defined formatting.
5pub const FMT_SKIP_ATTR: &str = "cairofmt::skip";
6
7/// An attribute to mark a function as a function that should be inlined.
8pub const INLINE_ATTR: &str = "inline";
9
10/// An attribute to define a type as a type that must be used, or a function as a function that its
11/// return value must be used.
12pub const MUST_USE_ATTR: &str = "must_use";
13
14/// An attribute to define an item as unstable. Usage of these items will result in a warning,
15/// unless the using crate is marked with their feature active.
16pub const UNSTABLE_ATTR: &str = "unstable";
17
18/// An attribute to define an item as deprecated. Usage of these items will result in a warning,
19/// unless the using crate is marked with their feature active.
20pub const DEPRECATED_ATTR: &str = "deprecated";
21
22/// An attribute to define an item as internal. Usage of these items will result in an error, unless
23/// the usage is marked with their feature active.
24pub const INTERNAL_ATTR: &str = "internal";
25
26/// An attribute to allow code that would normally result in a warning.
27pub const ALLOW_ATTR: &str = "allow";
28
29/// An attribute to allow usage of a feature under a statement.
30pub const FEATURE_ATTR: &str = "feature";
31
32/// An attribute to define the order of implicit arguments.
33pub const IMPLICIT_PRECEDENCE_ATTR: &str = "implicit_precedence";
34
35/// An attribute for the declaration of a starknet interface.
36///
37/// It is used in the starknet crate, however it is defined here because it is currently used in the
38/// corelib.
39/// TODO(Gil): Remove this once `starknet` is removed from corelib.
40pub const STARKNET_INTERFACE_ATTR: &str = "starknet::interface";
41
42/// An attribute to define a type as a phantom type, phantom types cannot be created at run time and
43/// are typically used for meta-programming.
44pub const PHANTOM_ATTR: &str = "phantom";