if (in_middle_of_path && segment.is_lower_self_seg ())
{
rust_error_at (segment.get_locus (), ErrorCode::E0433,
- "leading path segment %qs can only be used at the "
- "beginning of a path",
+ "%qs in paths can only be used in start position",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
{
if (!is_first_segment)
{
- rust_error_at (segment.get_locus (),
- "%<super%> can only be used in start position");
+ rust_error_at (
+ segment.get_locus (), ErrorCode::E0433,
+ "%<super%> in paths can only be used in start position");
return UNKNOWN_NODEID;
}
if (module_scope_id == crate_scope_id)
if (in_middle_of_path && segment->is_lower_self_seg ())
{
rust_error_at (segment->get_locus (), ErrorCode::E0433,
- "leading path segment %qs can only be used at the "
- "beginning of a path",
+ "%qs in paths can only be used in start position",
segment->as_string ().c_str ());
return false;
}
check_leading_kw_at_start (const S &segment, bool condition)
{
if (condition)
- rust_error_at (
- segment.get_locus (), ErrorCode::E0433,
- "leading path segment %qs can only be used at the beginning of a path",
- segment.as_string ().c_str ());
+ rust_error_at (segment.get_locus (), ErrorCode::E0433,
+ "%qs in paths can only be used in start position",
+ segment.as_string ().c_str ());
return condition;
}
}
pub use foo::super::foo::S as T;
-// { dg-error ".super. can only be used in start position" "" { target *-*-* } .-1 }
+// { dg-error ".super. in paths can only be used in start position" "" { target *-*-* } .-1 }
super::super::super::foo!(); // { dg-error "too many leading .super. keywords" }
// { dg-error "could not resolve macro invocation" "" { target *-*-* } .-1 }
- super::crate::foo!(); // { dg-error "leading path segment .crate. can only be used" }
+ super::crate::foo!(); // { dg-error ".crate. in paths can only be used" }
// { dg-error "could not resolve macro invocation" "" { target *-*-* } .-1 }
- crate::foo::bar::super::foo!(); // { dg-error "leading path segment .super. can only be used" }
+ crate::foo::bar::super::foo!(); // { dg-error ".super. in paths can only be used" }
// { dg-error "could not resolve macro invocation" "" { target *-*-* } .-1 }
}
}
crate::bar();
crate::self::foo();
- // { dg-error "leading path segment .self. can only be used at the beginning of a path" "" { target *-*-* } .-1 }
+ // { dg-error ".self. in paths can only be used in start position" "" { target *-*-* } .-1 }
}
type a = foo;
type b = crate::foo;
type c = self::foo;
type d = crate::self::foo;
-// { dg-error "leading path segment .self. can only be used at the beginning of a path" "" { target *-*-* } .-1 }
+// { dg-error ".self. in paths can only be used in start position" "" { target *-*-* } .-1 }