aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-06-14 07:17:11 +0000
committerGitHub <noreply@github.com>2022-06-14 07:17:11 +0000
commit1c679d7f42834a72956d6fb39c8d298dd6dc4b4e (patch)
treedce1ca0dd917ef4ea09bfa4809908bbe4dbe5dae /gcc/rust/parse/rust-parse-impl.h
parent25974baf19caf2b38c3755ce00a3065c62472053 (diff)
parent7ca7362602d4e827ecbc39d5cfdf56df9044633b (diff)
downloadgcc-1c679d7f42834a72956d6fb39c8d298dd6dc4b4e.zip
gcc-1c679d7f42834a72956d6fb39c8d298dd6dc4b4e.tar.gz
gcc-1c679d7f42834a72956d6fb39c8d298dd6dc4b4e.tar.bz2
Merge #1307
1307: Handle super and crate in path resolution r=CohenArthur a=philberty This patch completely reimplements our name resolution process for Paths in general. This patch gets rid of the old Resolver::Definition structures which were used so that we can map patterns back to LetStmts and establish an hierarchy of nodes. This was not nessecary and complicated name/type resolution. TypePaths and PathInExpression are similar but have a slightl tweak in the order they lookup the relevant scopes for types. But overall work the same. There are several cases of paths you must consider in type resolution: - i32 (simple type path) - Self::A (associated type reference) - mod::foo::impl_item() (reference to impl item) - super::foo (reference to item) - crate::foo - T::bound() In name resolution we cannot always fully resolve a path but have to rely on the type-resolution to fully resolve a path as it may require careful thought. For example a path like: mod::foo::item() might be for a generic foo<T>(), which might have two specialized impl blocks so the best the name resolution can do is resolve mod::foo then leave it up to the type resolution to figure out which item this is. We might have i32 which is just a simple lookup. Apart from that this patch introduces a module parent child hierachy so that on paths such as super::foo we resolve super to be our parent module scope then foo can be resolved with the lookup in the items for that module. More over this patch gets rid of some but not all of the awkward name canonicalization to try and patch paths directly. More cleanup is still needed here to make the name resolution step easier to read. This was notable in the Qualified path handling where we can now rely on the type resolver to setup the associated types properly rather than the name resolver requiring us to resolve this directly. Fixes #1251 #1230 Addresses #1227 #1153 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
0 files changed, 0 insertions, 0 deletions