From 3016c44e535fe134d88c03ec3d61e3066e43180c Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Mon, 26 Jun 2023 14:47:06 +0200 Subject: gccrs: Remove Rust::Optional in favor of tl::optional gcc/rust/ChangeLog: * Make-lang.in: Remove rust-optional-test.cc's object file * ast/rust-macro.h: Remove use of Rust::Optional * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_for_privacy_violation): Likewise. (PrivacyReporter::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.h: Likewise. * checks/errors/rust-feature-gate.cc (FeatureGate::check): Likewise. * checks/errors/rust-feature.cc (Feature::create): Likewise. (Feature::as_name): Likewise. * checks/errors/rust-feature.h: Likewise. * expand/rust-macro-builtins.cc: Likewise. * lex/rust-lex.cc (Lexer::Lexer): Likewise. (Lexer::skip_token): Likewise. (Lexer::dump_and_skip): Likewise. * lex/rust-lex.h: Likewise. * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise. * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise. * rust-lang.cc (run_rust_tests): Likewise. * rust-session-manager.cc (Session::compile_crate): Likewise. (TargetOptions::dump_target_options): Likewise. * rust-session-manager.h (struct TargetOptions): Likewise. * util/rust-hir-map.cc (Mappings::lookup_module_children): Likewise. (Mappings::lookup_module_chidren_items): Likewise. (Mappings::lookup_module_child): Likewise. (Mappings::lookup_parent_module): Likewise. * util/rust-hir-map.h (RUST_HIR_MAP_H): Likewise. * util/rust-optional-test.cc: Removed. * util/rust-optional.h: Removed. --- gcc/rust/resolve/rust-ast-resolve-path.cc | 8 ++++---- gcc/rust/resolve/rust-ast-resolve-type.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gcc/rust/resolve') diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc b/gcc/rust/resolve/rust-ast-resolve-path.cc index 1b0edcc..0e23ef1 100644 --- a/gcc/rust/resolve/rust-ast-resolve-path.cc +++ b/gcc/rust/resolve/rust-ast-resolve-path.cc @@ -164,10 +164,10 @@ ResolvePath::resolve_path (AST::PathInExpression *expr) if (resolved_node_id == UNKNOWN_NODEID && previous_resolved_node_id == module_scope_id) { - Optional resolved_child + tl::optional resolved_child = mappings->lookup_module_child (module_scope_id, ident_seg.as_string ()); - if (resolved_child.is_some ()) + if (resolved_child.has_value ()) { NodeId resolved_node = resolved_child->get_node_id (); if (resolver->get_name_scope ().decl_was_declared_here ( @@ -303,10 +303,10 @@ ResolvePath::resolve_path (AST::SimplePath *expr) continue; } - Optional resolved_child + tl::optional resolved_child = mappings->lookup_module_child (module_scope_id, segment.get_segment_name ()); - if (resolved_child.is_some ()) + if (resolved_child.has_value ()) { NodeId resolved_node = resolved_child->get_node_id (); if (resolver->get_name_scope ().decl_was_declared_here ( diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc index 6ffb36d..34d45a9 100644 --- a/gcc/rust/resolve/rust-ast-resolve-type.cc +++ b/gcc/rust/resolve/rust-ast-resolve-type.cc @@ -198,10 +198,10 @@ ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id) if (resolved_node_id == UNKNOWN_NODEID && previous_resolved_node_id == module_scope_id) { - Optional resolved_child + tl::optional resolved_child = mappings->lookup_module_child (module_scope_id, ident_seg.as_string ()); - if (resolved_child.is_some ()) + if (resolved_child.has_value ()) { NodeId resolved_node = resolved_child->get_node_id (); if (resolver->get_name_scope ().decl_was_declared_here ( -- cgit v1.1