aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-item.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-13 10:50:13 +0000
committerGitHub <noreply@github.com>2021-04-13 10:50:13 +0000
commit636ad7d95e0f2afa1544ba7deeadf3d52de18a82 (patch)
treefc50976ff47ed0e69ec2d483188e075f7066d2d2 /gcc/rust/backend/rust-compile-item.h
parentca8744db3e56bfcf0cf3f0e2a0bf76450aef9438 (diff)
parent4ee35b6edb549be11571536bf78f8585a0282991 (diff)
downloadgcc-636ad7d95e0f2afa1544ba7deeadf3d52de18a82.zip
gcc-636ad7d95e0f2afa1544ba7deeadf3d52de18a82.tar.gz
gcc-636ad7d95e0f2afa1544ba7deeadf3d52de18a82.tar.bz2
Merge #358
358: Canonical Paths for Name Resolution and handle TurboFish properly r=philberty a=philberty Add Canonical paths to name resolution In order to support name resolution and checks for duplicate definitions of names we need canonical paths for all DefId items such as inherent impl items and normal items. Consider: ```rust struct Foo<T>(T); impl Foo<f32> { fn name()... } impl Foo<i32> { fn name()... } ``` Each of the impl blocks have a name function but these are separate due to the concrete impl of the Parameter type passed in. The caveat here is that to call this Function name the programmer must be explicit in which implentation they wish to call such as: ```rust let a = Foo::<f32>::name(); ``` This lets the Path probe lookup the appropriate impl block. The problem here is that rust also allows for the compiler to infer the impl you wish such as: ```rust let a = Foo::name(); ``` This should fail since there are multiple candidates possible for this Path. Unless there might have only been one name function in which case it would have worked. This patch is also responsible to implement PathInExpression by iterating each segment and applying generic arguments as we go. Fixes #355 #335 #325 #353 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-item.h')
0 files changed, 0 insertions, 0 deletions