diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-05-02 14:32:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 14:32:12 +0000 |
commit | fb136314f9584744ccc7b09ace3cea99129b7cf4 (patch) | |
tree | 49040fe0347cbe57412c4fd79d7e2e55c18abcc0 /gcc/rust/resolve/rust-ast-resolve-item.h | |
parent | 27e562a2c07c9f09c80f905cf7ebc4a5b25672eb (diff) | |
parent | 98e1de2d8fdc0f39af161284d2cc74755aa1d260 (diff) | |
download | gcc-fb136314f9584744ccc7b09ace3cea99129b7cf4.zip gcc-fb136314f9584744ccc7b09ace3cea99129b7cf4.tar.gz gcc-fb136314f9584744ccc7b09ace3cea99129b7cf4.tar.bz2 |
Merge #1191
1191: Resolve simple paths in use items r=CohenArthur a=CohenArthur
In order to resolve `SimplePath`s, we have to expand all paths present
in a `UseDeclaration` and resolve them. For example, we want to resolve
two paths with the following statement `use foo::bar::{baz, bul}`:
`foo::bar::baz` and `foo::bar::bul`
This also removes the prelude inclusion (`use std::prelude::v1::*`)
since we cannot resolve it (yet!)
Needs #1172 to compile
Adresses #1159
Adresses #1187
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-item.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-item.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h index da5d4e8..e6b11f5 100644 --- a/gcc/rust/resolve/rust-ast-resolve-item.h +++ b/gcc/rust/resolve/rust-ast-resolve-item.h @@ -26,6 +26,7 @@ #include "rust-ast-resolve-type.h" #include "rust-ast-resolve-pattern.h" #include "rust-ast-resolve-stmt.h" +#include "config.h" namespace Rust { namespace Resolver { @@ -81,6 +82,7 @@ public: void visit (AST::TraitImpl &impl_block) override; void visit (AST::Trait &trait) override; void visit (AST::ExternBlock &extern_block) override; + void visit (AST::UseDeclaration &) override; protected: void resolve_impl_item (AST::TraitImplItem *item, const CanonicalPath &prefix, @@ -136,4 +138,13 @@ private: } // namespace Resolver } // namespace Rust +#if CHECKING_P + +namespace selftest { +extern void +rust_simple_path_resolve_test (void); +} // namespace selftest + +#endif // CHECKING_P + #endif // RUST_AST_RESOLVE_ITEM_H |