diff options
author | Muhammad Mahad <mahadtxt@gmail.com> | 2023-06-20 00:47:19 +0500 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2023-06-21 12:51:40 +0000 |
commit | c93eb308c5ad272059d690980813746895116c71 (patch) | |
tree | a524e1b2bfff4dd16a7b0e64350e48844de522f1 | |
parent | 065d8c4d79d180f26f51d4e6d88a99a348113906 (diff) | |
download | gcc-c93eb308c5ad272059d690980813746895116c71.zip gcc-c93eb308c5ad272059d690980813746895116c71.tar.gz gcc-c93eb308c5ad272059d690980813746895116c71.tar.bz2 |
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 <mahadtxt@gmail.com>
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-path.cc | 6 | ||||
-rw-r--r-- | 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 ab93333..1b0edcc 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 f315985..6ffb36d 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 ()); |