We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 25acd93 + b86a1d1 commit 0254928Copy full SHA for 0254928
compiler/rustc_parse/src/parser/generics.rs
@@ -118,7 +118,7 @@ impl<'a> Parser<'a> {
118
Some(this.parse_ty_param(attrs)?)
119
} else if this.token.can_begin_type() {
120
// Trying to write an associated type bound? (#26271)
121
- let snapshot = this.clone();
+ let snapshot = this.create_snapshot_for_diagnostic();
122
match this.parse_ty_where_predicate() {
123
Ok(where_predicate) => {
124
this.struct_span_err(
@@ -133,7 +133,7 @@ impl<'a> Parser<'a> {
133
Err(err) => {
134
err.cancel();
135
// FIXME - maybe we should overwrite 'self' outside of `collect_tokens`?
136
- *this = snapshot;
+ this.restore_snapshot(snapshot);
137
return Ok((None, TrailingToken::None));
138
}
139
0 commit comments