diff options
| author | bors <bors@rust-lang.org> | 2025-09-10 21:30:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-09-10 21:30:05 +0000 |
| commit | f4665ab8368ad2e8a86d4390ae35c28bdd9561bb (patch) | |
| tree | 301e5c15dcb2f6f64faf288a1fe2a1db1eaac790 /compiler/rustc_driver_impl/src/lib.rs | |
| parent | 565a9ca63e9df4b223fed0da01f15e578acfb538 (diff) | |
| parent | bb45ea3accf536e0915991c5d9120bab8a87541e (diff) | |
| download | rust-f4665ab8368ad2e8a86d4390ae35c28bdd9561bb.tar.gz rust-f4665ab8368ad2e8a86d4390ae35c28bdd9561bb.zip | |
Auto merge of #146418 - matthiaskrgr:rollup-za0lrux, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang/rust#145327 (std: make address resolution weirdness local to SGX) - rust-lang/rust#145879 (default auto traits: use default supertraits instead of `Self: Trait` bounds on associated items) - rust-lang/rust#146123 (Suggest examples of format specifiers in error messages) - rust-lang/rust#146311 (Minor symbol comment fixes.) - rust-lang/rust#146322 (Make Barrier RefUnwindSafe again) - rust-lang/rust#146327 (Add tests for deref on pin) - rust-lang/rust#146340 (Strip frontmatter in fewer places) - rust-lang/rust#146342 (Improve C-variadic error messages: part 2) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_driver_impl/src/lib.rs')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index f3ed6042105..d00a4c35834 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -51,6 +51,7 @@ use rustc_lint::unerased_lint_store; use rustc_metadata::creader::MetadataLoader; use rustc_metadata::locator; use rustc_middle::ty::TyCtxt; +use rustc_parse::lexer::StripTokens; use rustc_parse::{new_parser_from_file, new_parser_from_source_str, unwrap_or_emit_fatal}; use rustc_session::config::{ CG_OPTIONS, CrateType, ErrorOutputType, Input, OptionDesc, OutFileName, OutputType, Sysroot, @@ -1288,10 +1289,15 @@ fn warn_on_confusing_output_filename_flag( fn parse_crate_attrs<'a>(sess: &'a Session) -> PResult<'a, ast::AttrVec> { let mut parser = unwrap_or_emit_fatal(match &sess.io.input { - Input::File(file) => new_parser_from_file(&sess.psess, file, None), - Input::Str { name, input } => { - new_parser_from_source_str(&sess.psess, name.clone(), input.clone()) + Input::File(file) => { + new_parser_from_file(&sess.psess, file, StripTokens::ShebangAndFrontmatter, None) } + Input::Str { name, input } => new_parser_from_source_str( + &sess.psess, + name.clone(), + input.clone(), + StripTokens::ShebangAndFrontmatter, + ), }); parser.parse_inner_attributes() } |
