]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: nr: Disable flatten function for now
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 3 Jun 2026 09:22:27 +0000 (11:22 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 25 Jun 2026 17:21:28 +0000 (19:21 +0200)
gcc/rust/ChangeLog:

* resolve/rust-forever-stack.h: Comment out flatten with an explanation.
* resolve/rust-forever-stack.hxx: Likewise.
* resolve/rust-name-resolution-context.cc (NameResolutionContext::flatten): Likewise.
* resolve/rust-name-resolution-context.h: Likewise.

gcc/rust/resolve/rust-forever-stack.h
gcc/rust/resolve/rust-forever-stack.hxx
gcc/rust/resolve/rust-name-resolution-context.cc
gcc/rust/resolve/rust-name-resolution-context.h

index a2a031ddd99811ad2097170e106dbd098050a6e4..ada57d4d8f7cedfbc53b0c5e78baa5b886f1f172 100644 (file)
@@ -946,12 +946,15 @@ public:
   tl::expected<Definition, LookupFinalizeError>
   find_leaf_definition (const NodeId &key) const;
 
+  // Flattening is not needed for now but should be used later?
+#if 0
   /**
    * Look at NameResolutionContext::flatten - This is the inner working function
    * which works on one specific namespace, while NameResolutionContext::flatten
    * calls flatten for every namespace
    */
   void flatten ();
+#endif
 
   /* Map of "usage" nodes which have been resolved to a "definition" node */
   std::map<Usage, Definition> resolved_nodes;
index 9a21dc1ee1b1e354619a081c2f159839388cb3e3..c652e37f684b3f5be62ead5cb4f103a3e918727e 100644 (file)
@@ -766,6 +766,7 @@ ForeverStack<N>::find_leaf_definition (const NodeId &key) const
   return find_leaf_definition_inner (Usage (key), resolved_nodes, keys_seen);
 }
 
+#if 0
 template <Namespace N>
 void
 ForeverStack<N>::flatten ()
@@ -793,6 +794,7 @@ ForeverStack<N>::flatten ()
       k_v.second = result.value ();
     }
 }
+#endif
 
 // FIXME: Can we add selftests?
 
index 479d0cb46670467f74379c7309579058ef106eb6..7bb74b7e5208cbc4f3d675b916a20d8c5e8f0ed0 100644 (file)
@@ -372,6 +372,7 @@ NameResolutionContext::scoped (Rib::Kind rib_kind, Namespace ns,
     }
 }
 
+#if 0
 void
 NameResolutionContext::flatten ()
 {
@@ -380,6 +381,7 @@ NameResolutionContext::flatten ()
   macros.flatten ();
   labels.flatten ();
 }
+#endif
 
 } // namespace Resolver2_0
 } // namespace Rust
index f44fc2c5df544411844ae2caf74afdb055eece35..779f6a725da884270928ae6e8cd20abecd1d8179 100644 (file)
@@ -842,6 +842,9 @@ public:
                         std::forward<Args> (args)...);
   }
 
+  // We disable this function for now as it causes regressions, but I think it
+  // is important for a more proper final nameres context - need to investigate
+#if 0
   /**
    * We've now collected every definition and import, and errored out when
    * necessary if multiple definitions are colliding. Do a final flattening of
@@ -860,6 +863,7 @@ public:
    * void function, yipee.
    */
   void flatten ();
+#endif
 
   /* If declared with #[prelude_import], the current standard library module
    */
@@ -913,9 +917,6 @@ private:
   resolve_final_segment (ForeverStack<N> &stack,
                         typename ForeverStack<N>::Node &final_node,
                         std::string &seg_name, bool is_lower_self);
-
-  /* Map of "usage" nodes which have been resolved to a "definition" node */
-  // std::map<Usage, Definition> resolved_nodes;
 };
 
 } // namespace Resolver2_0