From: Muhammad Mahad Date: Mon, 19 Jun 2023 19:47:19 +0000 (+0500) Subject: gccrs: ErrorCode[E0433] Use of Undeclared Crate, Module, or Type X-Git-Tag: basepoints/gcc-15~2455 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7d480eef4e3ce9792f2c714551b656b7278d31e;p=thirdparty%2Fgcc.git 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 --- 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 ());