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 | |
| 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')
| -rw-r--r-- | src/parse/parser.rs | 8 | ||||
| -rw-r--r-- | src/parse/session.rs | 9 |
2 files changed, 10 insertions, 7 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) { diff --git a/src/parse/session.rs b/src/parse/session.rs index 1956e1b8cd7..81b5015dde3 100644 --- a/src/parse/session.rs +++ b/src/parse/session.rs @@ -4,7 +4,7 @@ use std::sync::atomic::{AtomicBool, Ordering}; use rustc_data_structures::sync::{Lrc, Send}; use rustc_errors::emitter::{Emitter, EmitterWriter}; use rustc_errors::translation::Translate; -use rustc_errors::{ColorConfig, Diagnostic, Handler, Level as DiagnosticLevel}; +use rustc_errors::{ColorConfig, Diagnostic, Handler, Level as DiagnosticLevel, TerminalUrl}; use rustc_session::parse::ParseSess as RawParseSess; use rustc_span::{ source_map::{FilePathMapping, SourceMap}, @@ -135,8 +135,10 @@ fn default_handler( let emitter = if hide_parse_errors { silent_emitter() } else { - let fallback_bundle = - rustc_errors::fallback_fluent_bundle(rustc_errors::DEFAULT_LOCALE_RESOURCES, false); + let fallback_bundle = rustc_errors::fallback_fluent_bundle( + rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), + false, + ); Box::new(EmitterWriter::stderr( emit_color, Some(source_map.clone()), @@ -147,6 +149,7 @@ fn default_handler( None, false, false, + TerminalUrl::No, )) }; Handler::with_emitter( |
