Expand description
Parsing utilities for RAPx contract attributes.
Parses raw #[rapx::<name>(...)] attributes (requires / invariant /
ensures) and resolves their properties for verification.
The supported shape is:
#[rapx::<name>(property_call, kind = "...")]where kind = "..." (a string literal) applies to the property in the same
attribute.
Re-exportsยง
use syn::Expr;๐use syn::Lit;๐use syn::Result as SynResult;๐use syn::Token;๐use syn::Type;๐use syn::parse::Parse;๐use syn::parse::ParseStream;๐use quote::ToTokens;๐use rustc_attr_ir::Attribute;๐use rustc_hir::def_id::DefId;๐use rustc_middle::ty::TyCtxt;๐use rustc_span::Symbol;๐use super::Property;๐
Structsยง
- Attr
Property ๐ - The raw syntactic form of a property call
tag(arg0, arg1, ...)parsed from an attribute โ the unevaluated stage, before semantic resolution into aProperty.
Functionsยง
- collect_
properties_ ๐from_ named_ attrs - is_
expected_ ๐syn_ rapx_ attr - Check whether an attribute path is exactly
rapx::<expected_name>. - is_
rapx_ ๐named_ attr - parse_
outer_ ๐attr - parse_
property_ ๐arg - Parse a single property argument as an
Expr. - parse_
property_ ๐head - Parse a property call head
tag(arg0, arg1, ...). - parse_
rapx_ ๐attr - Parse a raw attribute string into a structured
requiresproperty. - strip_
lifetime_ ๐ticks - Strips the leading
'from Rust lifetime tokens so thatsyncan parse them as regular identifier expressions inside attribute arguments. For example,'abecomesa,'staticbecomesstatic_lifetime. - type_
to_ ๐arg_ expr - Convert a parsed argument
Typeback into theExprform expected by the property builder: plain paths stayExpr::Path, everything else (generics, arrays, tuples, references) becomesExpr::Verbatim.