]> git.lizzy.rs Git - rust.git/commitdiff
test: Update tests with fallout of changes
authorGabriel Smith <gsmith@d3engineering.com>
Mon, 18 Nov 2019 19:57:46 +0000 (14:57 -0500)
committerGabriel Smith <gsmith@d3engineering.com>
Mon, 18 Nov 2019 22:23:22 +0000 (17:23 -0500)
The error messages of the two tests effected degraded in quality. The
errors no longer suggest types in other modules as they now assume that
the arguments are const args, not type args.

src/test/ui/privacy/privacy-ns1.rs
src/test/ui/privacy/privacy-ns1.stderr
src/test/ui/privacy/privacy-ns2.rs
src/test/ui/privacy/privacy-ns2.stderr

index 3326b12ffa5353086229632b16d716ab265a5b23..614375e5e51d5268d00bae3f37e96a76d9331a31 100644 (file)
@@ -32,7 +32,8 @@ pub fn Bar() { }
 fn test_glob2() {
     use foo2::*;
 
-    let _x: Box<Bar>;  //~ ERROR expected type, found function `Bar`
+    let _x: Box<Bar>;  //~ ERROR wrong number of const arguments: expected 0, found 1
+    //~^ ERROR wrong number of type arguments: expected 1, found 0
 }
 
 // neither public
index 3c766a33baae8d5a80c29214d9e038f9bd61d37e..45ca00f55ab596598b61c54ecaae4cf7e267b246 100644 (file)
@@ -20,30 +20,8 @@ LL | use foo2::Bar;
 LL | use foo3::Bar;
    |
 
-error[E0573]: expected type, found function `Bar`
-  --> $DIR/privacy-ns1.rs:35:17
-   |
-LL |     pub struct Baz;
-   |     --------------- similarly named struct `Baz` defined here
-...
-LL |     let _x: Box<Bar>;
-   |                 ^^^
-   |
-help: a struct with a similar name exists
-   |
-LL |     let _x: Box<Baz>;
-   |                 ^^^
-help: possible better candidates are found in other modules, you can import them into scope
-   |
-LL | use foo1::Bar;
-   |
-LL | use foo2::Bar;
-   |
-LL | use foo3::Bar;
-   |
-
 error[E0425]: cannot find function, tuple struct or tuple variant `Bar` in this scope
-  --> $DIR/privacy-ns1.rs:50:5
+  --> $DIR/privacy-ns1.rs:51:5
    |
 LL |     pub struct Baz;
    |     --------------- similarly named unit struct `Baz` defined here
@@ -65,7 +43,7 @@ LL | use foo3::Bar;
    |
 
 error[E0412]: cannot find type `Bar` in this scope
-  --> $DIR/privacy-ns1.rs:51:17
+  --> $DIR/privacy-ns1.rs:52:17
    |
 LL |     pub struct Baz;
    |     --------------- similarly named struct `Baz` defined here
@@ -86,7 +64,19 @@ LL | use foo2::Bar;
 LL | use foo3::Bar;
    |
 
-error: aborting due to 4 previous errors
+error[E0107]: wrong number of const arguments: expected 0, found 1
+  --> $DIR/privacy-ns1.rs:35:17
+   |
+LL |     let _x: Box<Bar>;
+   |                 ^^^ unexpected const argument
+
+error[E0107]: wrong number of type arguments: expected 1, found 0
+  --> $DIR/privacy-ns1.rs:35:13
+   |
+LL |     let _x: Box<Bar>;
+   |             ^^^^^^^^ expected 1 type argument
+
+error: aborting due to 5 previous errors
 
-Some errors have detailed explanations: E0412, E0423, E0425, E0573.
-For more information about an error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0107, E0412, E0423, E0425.
+For more information about an error, try `rustc --explain E0107`.
index a2cc9e6aa9515de937212ddfcfb55b2c907ff8fc..0546de873f3404aeaa7ab4092bed04b92f3b0ee7 100644 (file)
@@ -38,14 +38,16 @@ pub fn Bar() { }
 fn test_single2() {
     use foo2::Bar;
 
-    let _x : Box<Bar>; //~ ERROR expected type, found function `Bar`
+    let _x : Box<Bar>; //~ ERROR wrong number of const arguments: expected 0, found 1
+    //~^ ERROR wrong number of type arguments: expected 1, found 0
     let _x : Bar(); //~ ERROR expected type, found function `Bar`
 }
 
 fn test_list2() {
     use foo2::{Bar,Baz};
 
-    let _x: Box<Bar>; //~ ERROR expected type, found function `Bar`
+    let _x: Box<Bar>; //~ ERROR wrong number of const arguments: expected 0, found 1
+    //~^ ERROR wrong number of type arguments: expected 1, found 0
 }
 
 // neither public
index 6f54259f91867fe1cb3ce9127e0c0eaaa29c0a65..2871573130a60c8eb97af63ef38c8e75ea97ca4a 100644 (file)
@@ -36,22 +36,7 @@ LL | use foo3::Bar;
    |
 
 error[E0573]: expected type, found function `Bar`
-  --> $DIR/privacy-ns2.rs:41:18
-   |
-LL |     let _x : Box<Bar>;
-   |                  ^^^ not a type
-   |
-help: possible better candidates are found in other modules, you can import them into scope
-   |
-LL | use foo1::Bar;
-   |
-LL | use foo2::Bar;
-   |
-LL | use foo3::Bar;
-   |
-
-error[E0573]: expected type, found function `Bar`
-  --> $DIR/privacy-ns2.rs:42:14
+  --> $DIR/privacy-ns2.rs:43:14
    |
 LL |     let _x : Bar();
    |              ^^^^^ not a type
@@ -69,47 +54,49 @@ LL | use foo2::Bar;
 LL | use foo3::Bar;
    |
 
-error[E0573]: expected type, found function `Bar`
-  --> $DIR/privacy-ns2.rs:48:17
-   |
-LL |     pub struct Baz;
-   |     --------------- similarly named struct `Baz` defined here
-...
-LL |     let _x: Box<Bar>;
-   |                 ^^^
-   |
-help: a struct with a similar name exists
-   |
-LL |     let _x: Box<Baz>;
-   |                 ^^^
-help: possible better candidates are found in other modules, you can import them into scope
-   |
-LL | use foo1::Bar;
-   |
-LL | use foo2::Bar;
-   |
-LL | use foo3::Bar;
-   |
-
 error[E0603]: trait `Bar` is private
-  --> $DIR/privacy-ns2.rs:61:15
+  --> $DIR/privacy-ns2.rs:63:15
    |
 LL |     use foo3::Bar;
    |               ^^^
 
 error[E0603]: trait `Bar` is private
-  --> $DIR/privacy-ns2.rs:65:15
+  --> $DIR/privacy-ns2.rs:67:15
    |
 LL |     use foo3::Bar;
    |               ^^^
 
 error[E0603]: trait `Bar` is private
-  --> $DIR/privacy-ns2.rs:72:16
+  --> $DIR/privacy-ns2.rs:74:16
    |
 LL |     use foo3::{Bar,Baz};
    |                ^^^
 
-error: aborting due to 8 previous errors
+error[E0107]: wrong number of const arguments: expected 0, found 1
+  --> $DIR/privacy-ns2.rs:41:18
+   |
+LL |     let _x : Box<Bar>;
+   |                  ^^^ unexpected const argument
+
+error[E0107]: wrong number of type arguments: expected 1, found 0
+  --> $DIR/privacy-ns2.rs:41:14
+   |
+LL |     let _x : Box<Bar>;
+   |              ^^^^^^^^ expected 1 type argument
+
+error[E0107]: wrong number of const arguments: expected 0, found 1
+  --> $DIR/privacy-ns2.rs:49:17
+   |
+LL |     let _x: Box<Bar>;
+   |                 ^^^ unexpected const argument
+
+error[E0107]: wrong number of type arguments: expected 1, found 0
+  --> $DIR/privacy-ns2.rs:49:13
+   |
+LL |     let _x: Box<Bar>;
+   |             ^^^^^^^^ expected 1 type argument
+
+error: aborting due to 10 previous errors
 
-Some errors have detailed explanations: E0423, E0573, E0603.
-For more information about an error, try `rustc --explain E0423`.
+Some errors have detailed explanations: E0107, E0423, E0573, E0603.
+For more information about an error, try `rustc --explain E0107`.