[gcc r14-7684] gccrs: ErrorCode[E0433] Use of Undeclared Crate, Module, or Type
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 16 17:53:32 GMT 2024
https://gcc.gnu.org/g:a7d480eef4e3ce9792f2c714551b656b7278d31e
commit r14-7684-ga7d480eef4e3ce9792f2c714551b656b7278d31e
Author: Muhammad Mahad <mahadtxt@gmail.com>
Date: Tue Jun 20 00:47:19 2023 +0500
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 <mahadtxt@gmail.com>
Diff:
---
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 38e18bbbef0..67ff7d9bcd1 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 62fbf7fcef3..58f677d7909 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 ());
More information about the Gcc-cvs
mailing list