implement SnapshotParser
struct
This commit is contained in:
parent
192acb4b98
commit
3ded25204b
2 changed files with 33 additions and 6 deletions
|
@ -630,9 +630,9 @@ impl<'a> Parser<'a> {
|
|||
Ok(ty) => GenericArg::Type(ty),
|
||||
Err(err) => {
|
||||
if is_const_fn {
|
||||
if let Ok(expr) = snapshot.parse_expr_res(Restrictions::CONST_EXPR, None) {
|
||||
snapshot.unclosed_delims.extend(self.unclosed_delims.clone());
|
||||
*self = snapshot;
|
||||
if let Ok(expr) = (*snapshot).parse_expr_res(Restrictions::CONST_EXPR, None)
|
||||
{
|
||||
self.restore(snapshot);
|
||||
return Ok(Some(self.dummy_const_arg_needs_braces(err, expr.span)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue