cairo_lang_syntax/attribute/
consts.rs

1// Attributes which do 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 represent the unused lint-group, which represents all the unused lints.
30/// An argument to the `allow` attribute that represents a lint-group which suppresses all `unused`
31/// lints.
32pub const UNUSED: &str = "unused";
33
34/// An argument to the `allow` attribute that suppresses warnings for unused variables.
35/// Also included in the [`UNUSED`] lint group.
36pub const UNUSED_VARIABLES: &str = "unused_variables";
37
38/// An argument to the `allow` attribute that suppresses warnings for unused imports.
39/// Also included in the [`UNUSED`] lint group.
40pub const UNUSED_IMPORTS: &str = "unused_imports";
41
42/// An attribute to allow additional attributes on an item.
43pub const ALLOW_ATTR_ATTR: &str = "allow_attr";
44
45/// An attribute to allow usage of a feature under a statement.
46pub const FEATURE_ATTR: &str = "feature";
47
48/// An attribute to define the order of implicit arguments.
49pub const IMPLICIT_PRECEDENCE_ATTR: &str = "implicit_precedence";
50
51/// An attribute for the declaration of a Starknet interface.
52///
53/// It is used in the `starknet` crate; however, it is defined here because it is currently used in
54/// the corelib.
55/// TODO(Gil): Remove this once `starknet` is removed from corelib.
56pub const STARKNET_INTERFACE_ATTR: &str = "starknet::interface";
57
58/// An attribute to define a type as a phantom type, phantom types cannot be created at run time and
59/// are typically used for meta-programming.
60pub const PHANTOM_ATTR: &str = "phantom";
61
62/// An attribute to override a submodule's source file path.
63///
64/// Usage: #[path("relative/or/absolute/path.cairo")]
65/// Applies to: `mod` items with a semicolon body (file-based modules).
66pub const PATH_ATTR: &str = "path";