gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-path.cc
(ResolvePath::resolve_path): Adjust the error message for a lower
self segment in the middle of a path.
* resolve/rust-ast-resolve-type.cc
(ResolveRelativeTypePath::go): Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove self-path2.rs
* rust/compile/self-path2.rs: Adjust expected errors.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
if (in_middle_of_path && segment.is_lower_self_seg ())
{
rust_error_at (segment.get_locus (), ErrorCode::E0433,
- "failed to resolve: %<%s%> in paths can only be used "
- "in start position",
+ "leading path segment %qs can only be used at the "
+ "beginning of a path",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
if (in_middle_of_path && segment->is_lower_self_seg ())
{
rust_error_at (segment->get_locus (), ErrorCode::E0433,
- "failed to resolve: %qs in paths can only be used "
- "in start position",
+ "leading path segment %qs can only be used at the "
+ "beginning of a path",
segment->as_string ().c_str ());
return false;
}
pub_restricted_3.rs
redef_error2.rs
redef_error5.rs
-self-path2.rs
sizeof-stray-infer-var-bug.rs
struct-expr-parse.rs
undeclared_label.rs
crate::bar();
crate::self::foo();
- // { dg-error "failed to resolve: .self. in paths can only be used in start position" "" { target *-*-* } .-1 }
+ // { dg-error "leading path segment .self. can only be used at the beginning of a path" "" { target *-*-* } .-1 }
}
type a = foo;
type b = crate::foo;
type c = self::foo;
type d = crate::self::foo;
-// { dg-error "failed to resolve: .self. in paths can only be used in start position" "" { target *-*-* } .-1 }
+// { dg-error "leading path segment .self. can only be used at the beginning of a path" "" { target *-*-* } .-1 }