about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-08-23 15:21:18 +0800
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-08-24 18:57:29 +0800
commit453edebc703777dcfe39f8c1c7fa472d8ae7c70e (patch)
treedc82578a901301f79250fe46674cc897274ba4f7
parent50bbe01de0abe85d1a4c07a2f163e540c1508f0d (diff)
downloadrust-453edebc703777dcfe39f8c1c7fa472d8ae7c70e.tar.gz
rust-453edebc703777dcfe39f8c1c7fa472d8ae7c70e.zip
resolve: Leave a comment about name bindings for legacy derive helpers
-rw-r--r--compiler/rustc_resolve/src/ident.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs
index 2cf34ccb3ad..61e05b65f90 100644
--- a/compiler/rustc_resolve/src/ident.rs
+++ b/compiler/rustc_resolve/src/ident.rs
@@ -432,6 +432,11 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                         }
                     }
                     Scope::DeriveHelpersCompat => {
+                        // FIXME: Try running this logic eariler, to allocate name bindings for
+                        // legacy derive helpers when creating an attribute invocation with
+                        // following derives. Legacy derive helpers are not common, so it shouldn't
+                        // affect performance. It should also allow to remove the `derives`
+                        // component from `ParentScope`.
                         let mut result = Err(Determinacy::Determined);
                         for derive in parent_scope.derives {
                             let parent_scope = &ParentScope { derives: &[], ..*parent_scope };