about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/generics/single-colon-path-not-const-generics.stderr4
-rw-r--r--tests/ui/suggestions/argument-list-from-path-sep-error-129273.fixed15
-rw-r--r--tests/ui/suggestions/argument-list-from-path-sep-error-129273.rs15
-rw-r--r--tests/ui/suggestions/argument-list-from-path-sep-error-129273.stderr14
-rw-r--r--tests/ui/suggestions/struct-field-type-including-single-colon.rs8
-rw-r--r--tests/ui/suggestions/struct-field-type-including-single-colon.stderr47
6 files changed, 79 insertions, 24 deletions
diff --git a/tests/ui/generics/single-colon-path-not-const-generics.stderr b/tests/ui/generics/single-colon-path-not-const-generics.stderr
index 4e695b2dcd6..c14a5e62a0c 100644
--- a/tests/ui/generics/single-colon-path-not-const-generics.stderr
+++ b/tests/ui/generics/single-colon-path-not-const-generics.stderr
@@ -1,8 +1,6 @@
 error: path separator must be a double colon
   --> $DIR/single-colon-path-not-const-generics.rs:8:18
    |
-LL | pub struct Foo {
-   |            --- while parsing this struct
 LL |   a: Vec<foo::bar:A>,
    |                  ^
    |
@@ -10,7 +8,7 @@ LL |   a: Vec<foo::bar:A>,
 help: use a double colon instead
    |
 LL |   a: Vec<foo::bar::A>,
-   |                  +
+   |                   +
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/argument-list-from-path-sep-error-129273.fixed b/tests/ui/suggestions/argument-list-from-path-sep-error-129273.fixed
new file mode 100644
index 00000000000..f5dbf0c8b6f
--- /dev/null
+++ b/tests/ui/suggestions/argument-list-from-path-sep-error-129273.fixed
@@ -0,0 +1,15 @@
+//@ run-rustfix
+
+use std::fmt;
+
+struct Hello;
+
+impl fmt::Display for Hello {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { //~ ERROR path separator must be a double colon
+        write!(f, "hello")
+    }
+}
+
+fn main() {
+    let _ = Hello;
+}
diff --git a/tests/ui/suggestions/argument-list-from-path-sep-error-129273.rs b/tests/ui/suggestions/argument-list-from-path-sep-error-129273.rs
new file mode 100644
index 00000000000..c41880a26f6
--- /dev/null
+++ b/tests/ui/suggestions/argument-list-from-path-sep-error-129273.rs
@@ -0,0 +1,15 @@
+//@ run-rustfix
+
+use std::fmt;
+
+struct Hello;
+
+impl fmt::Display for Hello {
+    fn fmt(&self, f: &mut fmt:Formatter) -> fmt::Result { //~ ERROR path separator must be a double colon
+        write!(f, "hello")
+    }
+}
+
+fn main() {
+    let _ = Hello;
+}
diff --git a/tests/ui/suggestions/argument-list-from-path-sep-error-129273.stderr b/tests/ui/suggestions/argument-list-from-path-sep-error-129273.stderr
new file mode 100644
index 00000000000..92947e3b177
--- /dev/null
+++ b/tests/ui/suggestions/argument-list-from-path-sep-error-129273.stderr
@@ -0,0 +1,14 @@
+error: path separator must be a double colon
+  --> $DIR/argument-list-from-path-sep-error-129273.rs:8:30
+   |
+LL |     fn fmt(&self, f: &mut fmt:Formatter) -> fmt::Result {
+   |                              ^
+   |
+   = note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
+help: use a double colon instead
+   |
+LL |     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+   |                               +
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/suggestions/struct-field-type-including-single-colon.rs b/tests/ui/suggestions/struct-field-type-including-single-colon.rs
index b7ad6d996f1..a3111028895 100644
--- a/tests/ui/suggestions/struct-field-type-including-single-colon.rs
+++ b/tests/ui/suggestions/struct-field-type-including-single-colon.rs
@@ -7,14 +7,14 @@ mod foo {
 
 struct Foo {
     a: foo:A,
-    //~^ ERROR found single colon in a struct field type path
-    //~| expected `,`, or `}`, found `:`
+    //~^ ERROR path separator must be a double colon
+    //~| ERROR struct `A` is private
 }
 
 struct Bar {
     b: foo::bar:B,
-    //~^ ERROR found single colon in a struct field type path
-    //~| expected `,`, or `}`, found `:`
+    //~^ ERROR path separator must be a double colon
+    //~| ERROR module `bar` is private
 }
 
 fn main() {}
diff --git a/tests/ui/suggestions/struct-field-type-including-single-colon.stderr b/tests/ui/suggestions/struct-field-type-including-single-colon.stderr
index 5ffc5b40849..ce16aca1e14 100644
--- a/tests/ui/suggestions/struct-field-type-including-single-colon.stderr
+++ b/tests/ui/suggestions/struct-field-type-including-single-colon.stderr
@@ -1,40 +1,53 @@
-error: found single colon in a struct field type path
+error: path separator must be a double colon
   --> $DIR/struct-field-type-including-single-colon.rs:9:11
    |
 LL |     a: foo:A,
    |           ^
    |
-help: write a path separator here
+   = note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
+help: use a double colon instead
    |
 LL |     a: foo::A,
    |            +
 
-error: expected `,`, or `}`, found `:`
-  --> $DIR/struct-field-type-including-single-colon.rs:9:11
-   |
-LL | struct Foo {
-   |        --- while parsing this struct
-LL |     a: foo:A,
-   |           ^
-
-error: found single colon in a struct field type path
+error: path separator must be a double colon
   --> $DIR/struct-field-type-including-single-colon.rs:15:16
    |
 LL |     b: foo::bar:B,
    |                ^
    |
-help: write a path separator here
+   = note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
+help: use a double colon instead
    |
 LL |     b: foo::bar::B,
    |                 +
 
-error: expected `,`, or `}`, found `:`
-  --> $DIR/struct-field-type-including-single-colon.rs:15:16
+error[E0603]: struct `A` is private
+  --> $DIR/struct-field-type-including-single-colon.rs:9:12
+   |
+LL |     a: foo:A,
+   |            ^ private struct
+   |
+note: the struct `A` is defined here
+  --> $DIR/struct-field-type-including-single-colon.rs:2:5
+   |
+LL |     struct A;
+   |     ^^^^^^^^^
+
+error[E0603]: module `bar` is private
+  --> $DIR/struct-field-type-including-single-colon.rs:15:13
    |
-LL | struct Bar {
-   |        --- while parsing this struct
 LL |     b: foo::bar:B,
-   |                ^
+   |             ^^^ - struct `B` is not publicly re-exported
+   |             |
+   |             private module
+   |
+note: the module `bar` is defined here
+  --> $DIR/struct-field-type-including-single-colon.rs:3:5
+   |
+LL |     mod bar {
+   |     ^^^^^^^
 
 error: aborting due to 4 previous errors
 
+For more information about this error, try `rustc --explain E0603`.