This commit is contained in:
Guillaume Gomez 2024-06-07 18:10:31 +02:00
parent 3670ad59ad
commit 6aab04e9b7

View File

@ -174,8 +174,7 @@ fn check_for_main_and_extern_crate(
let mut found_extern_crate = crate_name.is_none();
let mut found_macro = false;
let mut parser =
match new_parser_from_source_str(&psess, filename, source.clone()) {
let mut parser = match new_parser_from_source_str(&psess, filename, source.clone()) {
Ok(p) => p,
Err(errs) => {
errs.into_iter().for_each(|err| err.cancel());
@ -280,8 +279,7 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool {
let dcx = DiagCtxt::new(Box::new(emitter)).disable_warnings();
let psess = ParseSess::with_dcx(dcx, sm);
let mut parser =
match new_parser_from_source_str(&psess, filename, source.to_owned()) {
let mut parser = match new_parser_from_source_str(&psess, filename, source.to_owned()) {
Ok(p) => p,
Err(errs) => {
errs.into_iter().for_each(|err| err.cancel());