diff options
Diffstat (limited to 'gcc/rust/ast/rust-path.cc')
-rw-r--r-- | gcc/rust/ast/rust-path.cc | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/rust/ast/rust-path.cc b/gcc/rust/ast/rust-path.cc index 3aaf263..06c98cd 100644 --- a/gcc/rust/ast/rust-path.cc +++ b/gcc/rust/ast/rust-path.cc @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#include "rust-path.h" #include "rust-system.h" #include "rust-ast-full.h" #include "rust-diagnostics.h" @@ -135,7 +136,7 @@ PathExprSegment::as_string () const } std::string -PathPattern::as_string () const +RegularPath::as_string () const { std::string str; @@ -148,8 +149,15 @@ PathPattern::as_string () const return str; } +std::string +LangItemPath::as_string () const +{ + // FIXME: Handle #[lang] paths + rust_unreachable (); +} + SimplePath -PathPattern::convert_to_simple_path (bool with_opening_scope_resolution) const +RegularPath::convert_to_simple_path (bool with_opening_scope_resolution) const { if (!has_segments ()) return SimplePath::create_empty (); @@ -184,6 +192,18 @@ PathPattern::convert_to_simple_path (bool with_opening_scope_resolution) const } void +RegularPath::accept_vis (ASTVisitor &vis) +{ + vis.visit (*this); +} + +void +LangItemPath::accept_vis (ASTVisitor &vis) +{ + vis.visit (*this); +} + +void PathInExpression::accept_vis (ASTVisitor &vis) { vis.visit (*this); @@ -197,7 +217,7 @@ PathInExpression::as_string () const if (has_opening_scope_resolution) str = "::"; - return str + PathPattern::as_string (); + return str + path->as_string (); } std::string @@ -297,7 +317,7 @@ TypePathFunction::as_string () const std::string QualifiedPathInExpression::as_string () const { - return path_type.as_string () + "::" + PathPattern::as_string (); + return path_type.as_string () + "::" + path->as_string (); } std::string |