Skip to content

Commit

Permalink
ErrorCode[E0433] Use of Undeclared Crate, Module, or Type
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
MahadMuhammad committed Jun 21, 2023
1 parent b028c7e commit 8f75b3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions gcc/rust/resolve/rust-ast-resolve-path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ());
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions gcc/rust/resolve/rust-ast-resolve-type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ());
Expand Down

0 comments on commit 8f75b3e

Please sign in to comment.