Skip to content

Commit 2ee402a

Browse files
committed
Do not return an empty path on capitalized self
Path conversion returned an empty path for "Self" due to a hack in generics Self injection that prevented any "Self!" macro from beeing recognized correctly. gcc/rust/ChangeLog: * ast/rust-path.cc (Path::convert_to_simple_path): Do not exclude capitalized "Self". Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
1 parent e421059 commit 2ee402a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gcc/rust/ast/rust-path.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ Path::convert_to_simple_path (bool with_opening_scope_resolution) const
167167
for (const auto &segment : segments)
168168
{
169169
// return empty path if doesn't meet simple path segment requirements
170-
if (segment.is_error () || segment.has_generic_args ()
171-
|| segment.as_string () == "Self")
170+
if (segment.is_error () || segment.has_generic_args ())
172171
return SimplePath::create_empty ();
173172

174173
// create segment and add to vector

0 commit comments

Comments
 (0)