From 09e6684aadfd1b02bf4ca11bceea77c6ab2f6264 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Fri, 10 Jan 2025 13:28:45 -0500 Subject: [PATCH] remove implicit self injection --- .../resolve/rust-toplevel-name-resolver-2.0.cc | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc index 01252030cb6..64f84c4c9e8 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -97,23 +97,6 @@ TopLevel::visit (AST::Module &module) void TopLevel::visit (AST::Trait &trait) { - // FIXME: This Self injection is dodgy. It even lead to issues with metadata - // export in the past (#2349). We cannot tell appart injected parameters from - // regular ones. Dumping generic parameters highlights this Self in metadata, - // during debug or proc macro collection. This is clearly a hack. - // - // For now I'll keep it here in the new name resolver even if it should - // probably not be there. We need to find another way to solve this. - // Maybe an additional attribute to Trait ? - // - // From old resolver: - //// we need to inject an implicit self TypeParam here - //// FIXME: which location should be used for Rust::Identifier `Self`? - AST::TypeParam *implicit_self - = new AST::TypeParam ({"Self"}, trait.get_locus ()); - trait.insert_implict_self ( - std::unique_ptr (implicit_self)); - insert_or_error_out (trait.get_identifier (), trait, Namespace::Types);