aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorMahmoud Mohamed <mahadelr19@gmail.com>2023-03-13 17:18:11 +0300
committerPhilip Herron <philip.herron@embecosm.com>2023-03-15 11:14:06 +0000
commitbed6308e5e5201f409b041ca5e712d1ed8839195 (patch)
tree6942925354d10bc41582450b190be07b57a8e2bb /gcc/rust/backend
parentfc0addd1ffae33478cfc838f93e6685c0cbfa08c (diff)
downloadgcc-bed6308e5e5201f409b041ca5e712d1ed8839195.zip
gcc-bed6308e5e5201f409b041ca5e712d1ed8839195.tar.gz
gcc-bed6308e5e5201f409b041ca5e712d1ed8839195.tar.bz2
resolve: Handle multiple bindings to the same identifier
https://github.com/rust-lang/rust/blob/master/compiler/rustc_resolve/src/late.rs#L3168 This commit follows rustc's implementation of handling multiple bindings to the same identifier in parameters. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit) :declare and pass bindings to PatternDeclaration::go. (ResolveExpr::resolve_closure_param): Likewise. * resolve/rust-ast-resolve-expr.h: Likewise. * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise. (ResolveItem::visit): Likewise. * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go): Likewise. (PatternDeclaration::visit): check for previous identifier bindings before inserting the new one. * resolve/rust-ast-resolve-pattern.h (enum PatternBoundCtx): New enum. * resolve/rust-ast-resolve-stmt.h: pass bindings to PatterDeclaration::go. gcc/testsuite/ChangeLog: * rust/compile/multiple_bindings1.rs: New test. Signed-off-by: Mahmoud Mohamed <mahadelr19@gmail.com>
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions