about summary refs log tree commit diff
path: root/tests/ui/pub
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-06 03:07:46 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-07-12 03:02:57 +0000
commit692bc344d55cf9d86c60b06c92a70684d013c89f (patch)
tree4ab084f04f99c13c3a5e84aeb405867bc3319f96 /tests/ui/pub
parent5e311f933d844b6922256a0c0aa49b86159534f5 (diff)
downloadrust-692bc344d55cf9d86c60b06c92a70684d013c89f.tar.gz
rust-692bc344d55cf9d86c60b06c92a70684d013c89f.zip
Make parse error suggestions verbose and fix spans
Go over all structured parser suggestions and make them verbose style.

When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
Diffstat (limited to 'tests/ui/pub')
-rw-r--r--tests/ui/pub/pub-restricted.stderr30
1 files changed, 25 insertions, 5 deletions
diff --git a/tests/ui/pub/pub-restricted.stderr b/tests/ui/pub/pub-restricted.stderr
index 4694530e548..fc177aa2033 100644
--- a/tests/ui/pub/pub-restricted.stderr
+++ b/tests/ui/pub/pub-restricted.stderr
@@ -2,56 +2,76 @@ error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:3:6
    |
 LL | pub (a) fn afn() {}
-   |      ^ help: make this visible only to module `a` with `in`: `in a`
+   |      ^
    |
    = help: some possible visibility restrictions are:
            `pub(crate)`: visible only on the current crate
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
+help: make this visible only to module `a` with `in`
+   |
+LL | pub (in a) fn afn() {}
+   |      ~~~~
 
 error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:4:6
    |
 LL | pub (b) fn bfn() {}
-   |      ^ help: make this visible only to module `b` with `in`: `in b`
+   |      ^
    |
    = help: some possible visibility restrictions are:
            `pub(crate)`: visible only on the current crate
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
+help: make this visible only to module `b` with `in`
+   |
+LL | pub (in b) fn bfn() {}
+   |      ~~~~
 
 error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:5:6
    |
 LL | pub (crate::a) fn cfn() {}
-   |      ^^^^^^^^ help: make this visible only to module `crate::a` with `in`: `in crate::a`
+   |      ^^^^^^^^
    |
    = help: some possible visibility restrictions are:
            `pub(crate)`: visible only on the current crate
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
+help: make this visible only to module `crate::a` with `in`
+   |
+LL | pub (in crate::a) fn cfn() {}
+   |      ~~~~~~~~~~~
 
 error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:22:14
    |
 LL |         pub (a) invalid: usize,
-   |              ^ help: make this visible only to module `a` with `in`: `in a`
+   |              ^
    |
    = help: some possible visibility restrictions are:
            `pub(crate)`: visible only on the current crate
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
+help: make this visible only to module `a` with `in`
+   |
+LL |         pub (in a) invalid: usize,
+   |              ~~~~
 
 error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:31:6
    |
 LL | pub (xyz) fn xyz() {}
-   |      ^^^ help: make this visible only to module `xyz` with `in`: `in xyz`
+   |      ^^^
    |
    = help: some possible visibility restrictions are:
            `pub(crate)`: visible only on the current crate
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
+help: make this visible only to module `xyz` with `in`
+   |
+LL | pub (in xyz) fn xyz() {}
+   |      ~~~~~~
 
 error[E0742]: visibilities can only be restricted to ancestor modules
   --> $DIR/pub-restricted.rs:23:17