]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ErrorCode[E0433] Use of Undeclared Crate, Module, or Type
authorMuhammad Mahad <mahadtxt@gmail.com>
Mon, 19 Jun 2023 19:47:19 +0000 (00:47 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:29 +0000 (18:46 +0100)
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>
gcc/rust/resolve/rust-ast-resolve-path.cc
gcc/rust/resolve/rust-ast-resolve-type.cc

index 38e18bbbef0dae9f15648f9063f0d8f565ff2609..67ff7d9bcd1fa8b15327f436076eda9fcb99cba0 100644 (file)
@@ -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;
index 62fbf7fcef35a13b812b1c58833d82465be79281..58f677d79098949489ae7e67fc218dd8f1cd101f 100644 (file)
@@ -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 ());