self.struct_span_err(self.token.span, "found single colon in a struct field type path")
.span_suggestion_verbose(
self.token.span,
- "maybe you meant to write a path separator here",
+ "write a path separator here",
"::".to_string(),
Applicability::MaybeIncorrect,
)
--- /dev/null
+mod foo {
+ struct A;
+ mod bar {
+ struct B;
+ }
+}
+
+struct Foo {
+ a: foo:A,
+ //~^ ERROR found single colon in a struct field type path
+ //~| expected `,`, or `}`, found `:`
+}
+
+struct Bar {
+ b: foo::bar:B,
+ //~^ ERROR found single colon in a struct field type path
+ //~| expected `,`, or `}`, found `:`
+}
+
+fn main() {}
--- /dev/null
+error: found single colon in a struct field type path
+ --> $DIR/struct-field-type-including-single-colon.rs:9:11
+ |
+LL | a: foo:A,
+ | ^
+ |
+help: write a path separator here
+ |
+LL | a: foo::A,
+ | ~~
+
+error: expected `,`, or `}`, found `:`
+ --> $DIR/struct-field-type-including-single-colon.rs:9:11
+ |
+LL | a: foo:A,
+ | ^
+
+error: found single colon in a struct field type path
+ --> $DIR/struct-field-type-including-single-colon.rs:15:16
+ |
+LL | b: foo::bar:B,
+ | ^
+ |
+help: write a path separator here
+ |
+LL | b: foo::bar::B,
+ | ~~
+
+error: expected `,`, or `}`, found `:`
+ --> $DIR/struct-field-type-including-single-colon.rs:15:16
+ |
+LL | b: foo::bar:B,
+ | ^
+
+error: aborting due to 4 previous errors
+
+++ /dev/null
-mod foo {
- struct A;
- mod bar {
- struct B;
- }
-}
-
-struct Foo {
- a: foo:A,
- //~^ ERROR found single colon in a struct field type path
- //~| expected `,`, or `}`, found `:`
-}
-
-struct Bar {
- b: foo::bar:B,
- //~^ ERROR found single colon in a struct field type path
- //~| expected `,`, or `}`, found `:`
-}
-
-fn main() {}
+++ /dev/null
-error: found single colon in a struct field type path
- --> $DIR/sturct-field-type-including-single-colon.rs:9:11
- |
-LL | a: foo:A,
- | ^
- |
-help: maybe you meant to write a path separator here
- |
-LL | a: foo::A,
- | ~~
-
-error: expected `,`, or `}`, found `:`
- --> $DIR/sturct-field-type-including-single-colon.rs:9:11
- |
-LL | a: foo:A,
- | ^
-
-error: found single colon in a struct field type path
- --> $DIR/sturct-field-type-including-single-colon.rs:15:16
- |
-LL | b: foo::bar:B,
- | ^
- |
-help: maybe you meant to write a path separator here
- |
-LL | b: foo::bar::B,
- | ~~
-
-error: expected `,`, or `}`, found `:`
- --> $DIR/sturct-field-type-including-single-colon.rs:15:16
- |
-LL | b: foo::bar:B,
- | ^
-
-error: aborting due to 4 previous errors
-