mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
resolve: Scope::DeriveHelpers
-> Scope::DeriveHelpersCompat
These helpers are resolved before their respective derives through a kind of look ahead into future expansions. Some of these will migrate to proper resolution, others will be deprecated. ``` #[trait_helper] // Deprecate #[derive(Trait)] #[trait_helper] // Migrate to proper resolution ```
This commit is contained in:
parent
9b0214d9c5
commit
c064630e77
@ -368,7 +368,7 @@ impl<'a> Resolver<'a> {
|
||||
let mut suggestions = Vec::new();
|
||||
self.visit_scopes(scope_set, parent_scope, ident, |this, scope, use_prelude, _| {
|
||||
match scope {
|
||||
Scope::DeriveHelpers => {
|
||||
Scope::DeriveHelpersCompat => {
|
||||
let res = Res::NonMacroAttr(NonMacroAttrKind::DeriveHelper);
|
||||
if filter_fn(res) {
|
||||
for derive in parent_scope.derives {
|
||||
|
@ -97,7 +97,7 @@ impl Determinacy {
|
||||
/// but not for late resolution yet.
|
||||
#[derive(Clone, Copy)]
|
||||
enum Scope<'a> {
|
||||
DeriveHelpers,
|
||||
DeriveHelpersCompat,
|
||||
MacroRules(LegacyScope<'a>),
|
||||
CrateRoot,
|
||||
Module(Module<'a>),
|
||||
@ -1477,14 +1477,14 @@ impl<'a> Resolver<'a> {
|
||||
let mut scope = match ns {
|
||||
_ if is_absolute_path => Scope::CrateRoot,
|
||||
TypeNS | ValueNS => Scope::Module(module),
|
||||
MacroNS => Scope::DeriveHelpers,
|
||||
MacroNS => Scope::DeriveHelpersCompat,
|
||||
};
|
||||
let mut ident = ident.modern();
|
||||
let mut use_prelude = !module.no_implicit_prelude;
|
||||
|
||||
loop {
|
||||
let visit = match scope {
|
||||
Scope::DeriveHelpers => true,
|
||||
Scope::DeriveHelpersCompat => true,
|
||||
Scope::MacroRules(..) => true,
|
||||
Scope::CrateRoot => true,
|
||||
Scope::Module(..) => true,
|
||||
@ -1505,7 +1505,7 @@ impl<'a> Resolver<'a> {
|
||||
}
|
||||
|
||||
scope = match scope {
|
||||
Scope::DeriveHelpers =>
|
||||
Scope::DeriveHelpersCompat =>
|
||||
Scope::MacroRules(parent_scope.legacy),
|
||||
Scope::MacroRules(legacy_scope) => match legacy_scope {
|
||||
LegacyScope::Binding(binding) => Scope::MacroRules(
|
||||
|
@ -498,7 +498,7 @@ impl<'a> Resolver<'a> {
|
||||
Flags::empty(),
|
||||
));
|
||||
let result = match scope {
|
||||
Scope::DeriveHelpers => {
|
||||
Scope::DeriveHelpersCompat => {
|
||||
let mut result = Err(Determinacy::Determined);
|
||||
for derive in parent_scope.derives {
|
||||
let parent_scope = &ParentScope { derives: &[], ..*parent_scope };
|
||||
|
Loading…
Reference in New Issue
Block a user