diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-11-22 16:32:08 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-02-21 11:51:55 +1100 |
| commit | 6a56c3a930733b7e000cc3ec54844b0522a8bd16 (patch) | |
| tree | 304d1074fee6eed86861f93b7e1e56d76dbadd4f /compiler/rustc_parse/src/parser | |
| parent | 068db466e889d73c65007dc04a05a760e3d9f766 (diff) | |
| download | rust-6a56c3a930733b7e000cc3ec54844b0522a8bd16.tar.gz rust-6a56c3a930733b7e000cc3ec54844b0522a8bd16.zip | |
Use `ThinVec` in `ast::Impl` and related types.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index f164bb330f3..43e449a258f 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -646,20 +646,20 @@ impl<'a> Parser<'a> { &mut self, attrs: &mut AttrVec, mut parse_item: impl FnMut(&mut Parser<'a>) -> PResult<'a, Option<Option<T>>>, - ) -> PResult<'a, Vec<T>> { + ) -> PResult<'a, ThinVec<T>> { let open_brace_span = self.token.span; // Recover `impl Ty;` instead of `impl Ty {}` if self.token == TokenKind::Semi { self.sess.emit_err(errors::UseEmptyBlockNotSemi { span: self.token.span }); self.bump(); - return Ok(vec![]); + return Ok(ThinVec::new()); } self.expect(&token::OpenDelim(Delimiter::Brace))?; attrs.extend(self.parse_inner_attributes()?); - let mut items = Vec::new(); + let mut items = ThinVec::new(); while !self.eat(&token::CloseDelim(Delimiter::Brace)) { if self.recover_doc_comment_before_brace() { continue; |
