Skip to main content

Module attrs

Module attrs 

Source
Expand description

Attributes for anything that is not name resolution.

The fundamental idea of this module stems from the observation that most “interesting” attributes have a more memory-compact form than storing their full syntax, and that most of the attributes are flags, and those that are not are rare. Therefore, this module defines AttrFlags, which is a bitflag enum that contains only a yes/no answer to whether an attribute is present on an item. For most attributes, that’s all that is interesting us; for the rest of them, we define another query that extracts their data. A key part is that every one of those queries will have a wrapper method that queries (or is given) the AttrFlags and checks for the presence of the attribute; if it is not present, we do not call the query, to prevent Salsa from needing to record its value. This way, queries are only called on items that have the attribute, which is usually only a few.

Documentation (doc comments and #[doc = "..."] attributes) is handled by the docs submodule.

Re-exports§

pub use self::docs::Docs;
pub use self::docs::IsInnerDoc;

Modules§

docs
Documentation extraction and source mapping.

Structs§

AttrFlags
DeriveInfo
RustcLayoutScalarValidRange

Enums§

DocAtom 🔒

Functions§

attrs_from_ast_id_loc 🔒
attrs_source 🔒
collect_attrs 🔒
collect_field_attrs 🔒
crate_supports_no_std 🔒
Whether the crate root declares #![no_std], looking through cfg_attr gating.
extract_cfgs 🔒
extract_doc_aliases 🔒
extract_doc_tt_attr 🔒
extract_ra_completions 🔒
extract_ra_macro_style 🔒
extract_rustc_skip_during_method_dispatch 🔒
match_attr_flags 🔒
merge_repr 🔒
next_doc_expr 🔒
parse_extra_crate_attrs
parse_repr_tt 🔒
parse_rustc_legacy_const_generics 🔒
resolver_for_attr_def_id 🔒