aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-buffered-queue.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-06-29 16:14:33 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-06-29 16:35:52 +0100
commitf4a5629fb7f6274433005c255bc9baf113856a5d (patch)
treeb7c7d86aa682e9dc107e5743ccdc845d97d6ede6 /gcc/rust/rust-buffered-queue.h
parent18648e7b9f54c0cec4d4d865ff42b453b8de7101 (diff)
downloadgcc-f4a5629fb7f6274433005c255bc9baf113856a5d.zip
gcc-f4a5629fb7f6274433005c255bc9baf113856a5d.tar.gz
gcc-f4a5629fb7f6274433005c255bc9baf113856a5d.tar.bz2
Fix name resolution using self paths and nested functions
When we resolve paths the code was looking at the crate hierarchy first in the algorithm this leads to a bug where in rust you can have a function named foo at the item level then declare a nested function with the same name. So when we wanted to call the nested function the code was defaulting to the toplevel first resulting in bad name resolution. This patch updates the code to look at the scope first, then look at the module scope hierarchy. It finally adds the error handling in a nice single path at the end. We can only error out if its not the first segment since paths such as associated types like Self::foo we cannot resolve foo as this requires the type-resolution system to determine the projection. Fixes #1231
Diffstat (limited to 'gcc/rust/rust-buffered-queue.h')
0 files changed, 0 insertions, 0 deletions