From a7d480eef4e3ce9792f2c714551b656b7278d31e Mon Sep 17 00:00:00 2001 From: Muhammad Mahad Date: Tue, 20 Jun 2023 00:47:19 +0500 Subject: [PATCH] gccrs: ErrorCode[E0433] Use of Undeclared Crate, Module, or Type gcc/rust/ChangeLog: * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): called rust_error_at * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): called rust_error_at Signed-off-by: Muhammad Mahad --- gcc/rust/resolve/rust-ast-resolve-path.cc | 6 ++---- gcc/rust/resolve/rust-ast-resolve-type.cc | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc b/gcc/rust/resolve/rust-ast-resolve-path.cc index 38e18bbbef0d..67ff7d9bcd1f 100644 --- a/gcc/rust/resolve/rust-ast-resolve-path.cc +++ b/gcc/rust/resolve/rust-ast-resolve-path.cc @@ -62,9 +62,7 @@ ResolvePath::resolve_path (AST::PathInExpression *expr) bool in_middle_of_path = i > 0; if (in_middle_of_path && segment.is_lower_self_seg ()) { - // error[E0433]: failed to resolve: `self` in paths can only be used - // in start position - rust_error_at (segment.get_locus (), + rust_error_at (segment.get_locus (), ErrorCode ("E0433"), "failed to resolve: %<%s%> in paths can only be used " "in start position", segment.as_string ().c_str ()); @@ -208,7 +206,7 @@ ResolvePath::resolve_path (AST::PathInExpression *expr) } else if (is_first_segment) { - rust_error_at (segment.get_locus (), + rust_error_at (segment.get_locus (), ErrorCode ("E0433"), "Cannot find path %<%s%> in this scope", segment.as_string ().c_str ()); return UNKNOWN_NODEID; diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc index 62fbf7fcef35..58f677d79098 100644 --- a/gcc/rust/resolve/rust-ast-resolve-type.cc +++ b/gcc/rust/resolve/rust-ast-resolve-type.cc @@ -98,9 +98,7 @@ ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id) bool in_middle_of_path = i > 0; if (in_middle_of_path && segment->is_lower_self_seg ()) { - // error[E0433]: failed to resolve: `self` in paths can only be used - // in start position - rust_error_at (segment->get_locus (), + rust_error_at (segment->get_locus (), ErrorCode ("E0433"), "failed to resolve: %<%s%> in paths can only be used " "in start position", segment->as_string ().c_str ()); -- 2.47.2