diff options
| author | bors <bors@rust-lang.org> | 2022-03-23 03:31:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-03-23 03:31:20 +0000 |
| commit | 7b0bf9efc939341b48c6e9a335dee8a280085100 (patch) | |
| tree | 8daa45d4c70bfbd9213d6a04908ff8eb43f130df /compiler/rustc_parse/src/parser | |
| parent | 2b50739b4978936750a0c8de404ff184e49114f9 (diff) | |
| parent | 2f24923ab3f38e33a2ad98618852e0089d63ba7d (diff) | |
| download | rust-7b0bf9efc939341b48c6e9a335dee8a280085100.tar.gz rust-7b0bf9efc939341b48c6e9a335dee8a280085100.zip | |
Auto merge of #95223 - Dylan-DPC:rollup-idpb7ka, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #91608 (Fold aarch64 feature +fp into +neon) - #92955 (add perf side effect docs to `Iterator::cloned()`) - #94713 (Add u16::is_utf16_surrogate) - #95212 (Replace `this.clone()` with `this.create_snapshot_for_diagnostic()`) - #95219 (Modernize `alloc-no-oom-handling` test) - #95222 (interpret/validity: improve clarity) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/generics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs index 1b9eeab0298..d625080dee4 100644 --- a/compiler/rustc_parse/src/parser/generics.rs +++ b/compiler/rustc_parse/src/parser/generics.rs @@ -118,7 +118,7 @@ impl<'a> Parser<'a> { Some(this.parse_ty_param(attrs)?) } else if this.token.can_begin_type() { // Trying to write an associated type bound? (#26271) - let snapshot = this.clone(); + let snapshot = this.create_snapshot_for_diagnostic(); match this.parse_ty_where_predicate() { Ok(where_predicate) => { this.struct_span_err( @@ -133,7 +133,7 @@ impl<'a> Parser<'a> { Err(err) => { err.cancel(); // FIXME - maybe we should overwrite 'self' outside of `collect_tokens`? - *this = snapshot; + this.restore_snapshot(snapshot); return Ok((None, TrailingToken::None)); } } |
