Skip to content

Commit 0207a15

Browse files
author
Gabriel Smith
committed
test: Update tests with fallout of changes
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.
1 parent eaf8fd0 commit 0207a15

File tree

4 files changed

+54
-74
lines changed

4 files changed

+54
-74
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ pub mod foo2 {
3232
fn test_glob2() {
3333
use foo2::*;
3434

35-
let _x: Box<Bar>; //~ ERROR expected type, found function `Bar`
35+
let _x: Box<Bar>; //~ ERROR wrong number of const arguments: expected 0, found 1
36+
//~^ ERROR wrong number of type arguments: expected 1, found 0
3637
}
3738

3839
// neither public

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

+17-27
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,8 @@ LL | use foo2::Bar;
2020
LL | use foo3::Bar;
2121
|
2222

23-
error[E0573]: expected type, found function `Bar`
24-
--> $DIR/privacy-ns1.rs:35:17
25-
|
26-
LL | pub struct Baz;
27-
| --------------- similarly named struct `Baz` defined here
28-
...
29-
LL | let _x: Box<Bar>;
30-
| ^^^
31-
|
32-
help: a struct with a similar name exists
33-
|
34-
LL | let _x: Box<Baz>;
35-
| ^^^
36-
help: possible better candidates are found in other modules, you can import them into scope
37-
|
38-
LL | use foo1::Bar;
39-
|
40-
LL | use foo2::Bar;
41-
|
42-
LL | use foo3::Bar;
43-
|
44-
4523
error[E0425]: cannot find function, tuple struct or tuple variant `Bar` in this scope
46-
--> $DIR/privacy-ns1.rs:50:5
24+
--> $DIR/privacy-ns1.rs:51:5
4725
|
4826
LL | pub struct Baz;
4927
| --------------- similarly named unit struct `Baz` defined here
@@ -65,7 +43,7 @@ LL | use foo3::Bar;
6543
|
6644

6745
error[E0412]: cannot find type `Bar` in this scope
68-
--> $DIR/privacy-ns1.rs:51:17
46+
--> $DIR/privacy-ns1.rs:52:17
6947
|
7048
LL | pub struct Baz;
7149
| --------------- similarly named struct `Baz` defined here
@@ -86,7 +64,19 @@ LL | use foo2::Bar;
8664
LL | use foo3::Bar;
8765
|
8866

89-
error: aborting due to 4 previous errors
67+
error[E0107]: wrong number of const arguments: expected 0, found 1
68+
--> $DIR/privacy-ns1.rs:35:17
69+
|
70+
LL | let _x: Box<Bar>;
71+
| ^^^ unexpected const argument
72+
73+
error[E0107]: wrong number of type arguments: expected 1, found 0
74+
--> $DIR/privacy-ns1.rs:35:13
75+
|
76+
LL | let _x: Box<Bar>;
77+
| ^^^^^^^^ expected 1 type argument
78+
79+
error: aborting due to 5 previous errors
9080

91-
Some errors have detailed explanations: E0412, E0423, E0425, E0573.
92-
For more information about an error, try `rustc --explain E0412`.
81+
Some errors have detailed explanations: E0107, E0412, E0423, E0425.
82+
For more information about an error, try `rustc --explain E0107`.

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ pub mod foo2 {
3838
fn test_single2() {
3939
use foo2::Bar;
4040

41-
let _x : Box<Bar>; //~ ERROR expected type, found function `Bar`
41+
let _x : Box<Bar>; //~ ERROR wrong number of const arguments: expected 0, found 1
42+
//~^ ERROR wrong number of type arguments: expected 1, found 0
4243
let _x : Bar(); //~ ERROR expected type, found function `Bar`
4344
}
4445

4546
fn test_list2() {
4647
use foo2::{Bar,Baz};
4748

48-
let _x: Box<Bar>; //~ ERROR expected type, found function `Bar`
49+
let _x: Box<Bar>; //~ ERROR wrong number of const arguments: expected 0, found 1
50+
//~^ ERROR wrong number of type arguments: expected 1, found 0
4951
}
5052

5153
// neither public

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

+31-44
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,7 @@ LL | use foo3::Bar;
3636
|
3737

3838
error[E0573]: expected type, found function `Bar`
39-
--> $DIR/privacy-ns2.rs:41:18
40-
|
41-
LL | let _x : Box<Bar>;
42-
| ^^^ not a type
43-
|
44-
help: possible better candidates are found in other modules, you can import them into scope
45-
|
46-
LL | use foo1::Bar;
47-
|
48-
LL | use foo2::Bar;
49-
|
50-
LL | use foo3::Bar;
51-
|
52-
53-
error[E0573]: expected type, found function `Bar`
54-
--> $DIR/privacy-ns2.rs:42:14
39+
--> $DIR/privacy-ns2.rs:43:14
5540
|
5641
LL | let _x : Bar();
5742
| ^^^^^ not a type
@@ -69,47 +54,49 @@ LL | use foo2::Bar;
6954
LL | use foo3::Bar;
7055
|
7156

72-
error[E0573]: expected type, found function `Bar`
73-
--> $DIR/privacy-ns2.rs:48:17
74-
|
75-
LL | pub struct Baz;
76-
| --------------- similarly named struct `Baz` defined here
77-
...
78-
LL | let _x: Box<Bar>;
79-
| ^^^
80-
|
81-
help: a struct with a similar name exists
82-
|
83-
LL | let _x: Box<Baz>;
84-
| ^^^
85-
help: possible better candidates are found in other modules, you can import them into scope
86-
|
87-
LL | use foo1::Bar;
88-
|
89-
LL | use foo2::Bar;
90-
|
91-
LL | use foo3::Bar;
92-
|
93-
9457
error[E0603]: trait `Bar` is private
95-
--> $DIR/privacy-ns2.rs:61:15
58+
--> $DIR/privacy-ns2.rs:63:15
9659
|
9760
LL | use foo3::Bar;
9861
| ^^^
9962

10063
error[E0603]: trait `Bar` is private
101-
--> $DIR/privacy-ns2.rs:65:15
64+
--> $DIR/privacy-ns2.rs:67:15
10265
|
10366
LL | use foo3::Bar;
10467
| ^^^
10568

10669
error[E0603]: trait `Bar` is private
107-
--> $DIR/privacy-ns2.rs:72:16
70+
--> $DIR/privacy-ns2.rs:74:16
10871
|
10972
LL | use foo3::{Bar,Baz};
11073
| ^^^
11174

112-
error: aborting due to 8 previous errors
75+
error[E0107]: wrong number of const arguments: expected 0, found 1
76+
--> $DIR/privacy-ns2.rs:41:18
77+
|
78+
LL | let _x : Box<Bar>;
79+
| ^^^ unexpected const argument
80+
81+
error[E0107]: wrong number of type arguments: expected 1, found 0
82+
--> $DIR/privacy-ns2.rs:41:14
83+
|
84+
LL | let _x : Box<Bar>;
85+
| ^^^^^^^^ expected 1 type argument
86+
87+
error[E0107]: wrong number of const arguments: expected 0, found 1
88+
--> $DIR/privacy-ns2.rs:49:17
89+
|
90+
LL | let _x: Box<Bar>;
91+
| ^^^ unexpected const argument
92+
93+
error[E0107]: wrong number of type arguments: expected 1, found 0
94+
--> $DIR/privacy-ns2.rs:49:13
95+
|
96+
LL | let _x: Box<Bar>;
97+
| ^^^^^^^^ expected 1 type argument
98+
99+
error: aborting due to 10 previous errors
113100

114-
Some errors have detailed explanations: E0423, E0573, E0603.
115-
For more information about an error, try `rustc --explain E0423`.
101+
Some errors have detailed explanations: E0107, E0423, E0573, E0603.
102+
For more information about an error, try `rustc --explain E0107`.

0 commit comments

Comments
 (0)