-// Copyright (C) 2020-2025 Free Software Foundation, Inc.
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
// This file is part of GCC.
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 UNKNOWN_NODEID;
}
else
{
rust_error_at (segment.get_locus (),
- "Cannot find path %qs in this scope",
+ "Cannot find path %<%s%> in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
else if (is_first_segment)
{
rust_error_at (segment.get_locus (), ErrorCode::E0433,
- "Cannot find path %qs in this scope",
+ "Cannot find path %<%s%> in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
else
{
rust_error_at (segment.get_locus (),
- "Cannot find path %qs in this scope",
+ "Cannot find path %<%s%> in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
if (resolved_node_id == UNKNOWN_NODEID)
{
rust_error_at (segment.get_locus (),
- "cannot find simple path segment %qs in this scope",
+ "cannot find simple path segment %<%s%> in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
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 }