diff options
| author | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2023-06-19 21:57:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-19 21:57:03 -0500 |
| commit | ec8a4d41f1f178a19d9e5217e91d17bb0be4674a (patch) | |
| tree | 4031d9544a05e7925755da94424eee112738ae80 /src/parse/parser.rs | |
| parent | f4201ef2cb89c28bcdb82cab292720eb66b75695 (diff) | |
| parent | 0b17d7ea4605fcd3675c80069e0b5e82c4332b05 (diff) | |
Merge pull request #5788 from calebcartwright/subtree-sync-2023-06-19
sync subtree in prep for next release
Diffstat (limited to 'src/parse/parser.rs')
| -rw-r--r-- | src/parse/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parse/parser.rs b/src/parse/parser.rs index e0bd065518b..6bc53159b38 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -2,12 +2,12 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; use std::path::{Path, PathBuf}; use rustc_ast::token::TokenKind; -use rustc_ast::{ast, ptr}; +use rustc_ast::{ast, attr, ptr}; use rustc_errors::Diagnostic; use rustc_parse::{new_parser_from_file, parser::Parser as RawParser}; use rustc_span::{sym, Span}; +use thin_vec::ThinVec; -use crate::attr::first_attr_value_str_by_name; use crate::parse::session::ParseSess; use crate::Input; @@ -92,7 +92,7 @@ pub(crate) enum ParserError { impl<'a> Parser<'a> { pub(crate) fn submod_path_from_attr(attrs: &[ast::Attribute], path: &Path) -> Option<PathBuf> { - let path_sym = first_attr_value_str_by_name(attrs, sym::path)?; + let path_sym = attr::first_attr_value_str_by_name(attrs, sym::path)?; let path_str = path_sym.as_str(); // On windows, the base path might have the form @@ -109,7 +109,7 @@ impl<'a> Parser<'a> { sess: &'a ParseSess, path: &Path, span: Span, - ) -> Result<(ast::AttrVec, Vec<ptr::P<ast::Item>>, Span), ParserError> { + ) -> Result<(ast::AttrVec, ThinVec<ptr::P<ast::Item>>, Span), ParserError> { let result = catch_unwind(AssertUnwindSafe(|| { let mut parser = new_parser_from_file(sess.inner(), path, Some(span)); match parser.parse_mod(&TokenKind::Eof) { |
