StructsΒ§
- Field
Info π - Field information passed to the builder. Deliberately omits attrs to discourage the
generate_*methods from walking the attributes themselves. - Subdiagnostic
Variant π
EnumsΒ§
- Allow
Multiple πAlternatives - Applicability π
Applicabilityof a suggestion - mirrorsrustc_errors::Applicability- and used to represent the userβs selection of applicability if specified in an attribute.- Field
Inner πTy - Inner type of a field and type of wrapper.
- Subdiagnostic
Kind π - Types of subdiagnostics that can be created using attributes
- Suggestion
Kind π - Possible styles for suggestion subdiagnostics.
ConstantsΒ§
- CODE_
IDENT_ πCOUNT
TraitsΒ§
- HasField
Map π - SetOnce π
- Small helper trait for abstracting over
Optionfields that contain a value and aSpanfor error reporting if they are set more than once.
FunctionsΒ§
- build_
field_ πmapping - Build the mapping of field names to fields. This allows attributes to peek values from other fields.
- build_
suggestion_ πcode - Constructs the
format!()invocation(s) necessary for a#[suggestion*(code = "foo")]or#[suggestion*(code("foo", "bar"))]attribute field - is_
doc_ πcomment - new_
code_ πident - Returns an ident of the form
__code_NwhereNis incremented once with every call. - parse_
suggestion_ πvalues - report_
error_ πif_ not_ applied_ to_ applicability - Reports an error if the fieldβs type is not
Applicability. - report_
error_ πif_ not_ applied_ to_ span - Reports an error if the fieldβs type is not
Span. - report_
error_ πif_ not_ applied_ to_ ty - Reports an error if the fieldβs type does not match
path. - report_
type_ πerror - Reports a type error for field with
attr. - should_
generate_ πarg - Returns
trueiffieldshould generate aargcall rather than any other diagnostic call (likespan_label). - type_
is_ πbool - Checks whether the type
tyisbool. - type_
is_ πunit - Checks whether the type
tyis(). - type_
matches_ πpath - Checks whether the type name of
tymatchesname.
Type AliasesΒ§
- Field
Map π - Spanned
Option π - An
Option<T>that keeps track of the span that caused it to be set; used withSetOnce.