pub enum PureParam {
SelfValue {
is_ref: bool,
is_mut: bool,
},
Typed {
name: String,
ty: PureType,
is_mut: bool,
pat: Option<PurePattern>,
},
}Expand description
Function parameter.
Variants§
SelfValue
self
Typed
Named parameter.
Fields
is_mut: boolmut binding qualifier (e.g. fn f(mut x: T)).
Must be preserved across roundtrip; losing it produces E0596
“cannot borrow as mutable” the next time the executor re-renders
the file, because every mutating use of x loses its backing
mutability.
pat: Option<PurePattern>Original parameter pattern, when the source used something
richer than a bare identifier — e.g.
fn execute_group(SpecGroup { x, .. }: SpecGroup) or
fn tuple((a, b): (u32, u32)).
None for the common Pat::Ident case (the binding name in
name is sufficient to re-emit). Some instructs to_syn
to render the original pattern verbatim instead of
synthesising a Pat::Ident { name }, which would parse as
Pat::Path (and the cargo “patterns aren’t allowed in
functions without bodies” error) whenever the lossy
pat_to_name collapse produced an uppercase-leading binding
like SpecGroup. Retires the defensive RL061 detect filter
added in f196d30d.