1
Fork 0

Auto merge of #84401 - crlf0710:impl_main_by_path, r=petrochenkov

Implement RFC 1260 with feature_name `imported_main`.

This is the second extraction part of #84062 plus additional adjustments.
This (mostly) implements RFC 1260.

However there's still one test case failure in the extern crate case. Maybe `LocalDefId` doesn't work here? I'm not sure.

cc https://github.com/rust-lang/rust/issues/28937
r? `@petrochenkov`
This commit is contained in:
bors 2021-04-30 06:59:37 +00:00
commit bcd696d722
38 changed files with 463 additions and 193 deletions

View file

@ -20,7 +20,7 @@ use rustc_attr::{self as attr, is_builtin_attr};
use rustc_data_structures::map_in_place::MapInPlace;
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_data_structures::sync::Lrc;
use rustc_errors::{Applicability, PResult};
use rustc_errors::{Applicability, FatalError, PResult};
use rustc_feature::Features;
use rustc_parse::parser::{AttemptLocalParseRecovery, ForceCollect, Parser, RecoverComma};
use rustc_parse::validate_attr;
@ -414,6 +414,8 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
kind.article(), kind.descr()
),
);
// FIXME: this workaround issue #84569
FatalError.raise();
}
};
self.cx.trace_macros_diag();