We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
From
LhsExpr
1 parent b9de4ef commit 194d357Copy full SHA for 194d357
src/libsyntax/parse/parser/expr.rs
@@ -66,6 +66,10 @@ pub(super) enum LhsExpr {
66
}
67
68
impl From<Option<ThinVec<Attribute>>> for LhsExpr {
69
+ /// Converts `Some(attrs)` into `LhsExpr::AttributesParsed(attrs)`
70
+ /// and `None` into `LhsExpr::NotYetParsed`.
71
+ ///
72
+ /// This conversion does not allocate.
73
fn from(o: Option<ThinVec<Attribute>>) -> Self {
74
if let Some(attrs) = o {
75
LhsExpr::AttributesParsed(attrs)
@@ -76,6 +80,9 @@ impl From<Option<ThinVec<Attribute>>> for LhsExpr {
76
80
77
81
78
82
impl From<P<Expr>> for LhsExpr {
83
+ /// Converts the `expr: P<Expr>` into `LhsExpr::AlreadyParsed(expr)`.
84
85
79
86
fn from(expr: P<Expr>) -> Self {
87
LhsExpr::AlreadyParsed(expr)
88
0 commit comments