Skip to content

Commit

Permalink
Replace placeholder to avoid round trip over proc macro bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 27, 2022
1 parent a9759cf commit a0ed0d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2868,7 +2868,14 @@ pub(crate) mod parsing {
}
for part in float_repr.split('.') {
let index = crate::parse_str(part).map_err(|err| Error::new(float.span(), err))?;
let meaningless_placeholder = Expr::Verbatim(TokenStream::new());
let meaningless_placeholder = Expr::Path(ExprPath {
attrs: Vec::new(),
qself: None,
path: Path {
leading_colon: None,
segments: Punctuated::new(),
},
});
let base = mem::replace(e, meaningless_placeholder);
*e = Expr::Field(ExprField {
attrs: Vec::new(),
Expand Down

0 comments on commit a0ed0d3

Please sign in to comment.