Skip to content

Commit 61b172a

Browse files
committed
test: Make one multi suggestion test unicode
1 parent 119574f commit 61b172a

File tree

3 files changed

+282
-0
lines changed

3 files changed

+282
-0
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
error[E0423]: expected function, tuple struct or tuple variant, found struct `std::collections::HashMap`
2+
--> $DIR/multi-suggestion.rs:17:13
3+
|
4+
LL | let _ = std::collections::HashMap();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
--> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
7+
|
8+
= note: `std::collections::HashMap` defined here
9+
|
10+
help: you might have meant to use an associated function to build this type
11+
|
12+
LL | let _ = std::collections::HashMap::new();
13+
| +++++
14+
LL - let _ = std::collections::HashMap();
15+
LL + let _ = std::collections::HashMap::with_capacity(_);
16+
|
17+
LL - let _ = std::collections::HashMap();
18+
LL + let _ = std::collections::HashMap::with_hasher(_);
19+
|
20+
LL - let _ = std::collections::HashMap();
21+
LL + let _ = std::collections::HashMap::with_capacity_and_hasher(_, _);
22+
|
23+
help: consider using the `Default` trait
24+
|
25+
LL | let _ = <std::collections::HashMap as std::default::Default>::default();
26+
| + ++++++++++++++++++++++++++++++++++
27+
28+
error[E0423]: cannot initialize a tuple struct which contains private fields
29+
--> $DIR/multi-suggestion.rs:11:19
30+
|
31+
LL | wtf: Some(Box(U {
32+
| ^^^
33+
|
34+
note: constructor is not visible here due to private fields
35+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
36+
|
37+
= note: private field
38+
|
39+
= note: private field
40+
help: you might have meant to use an associated function to build this type
41+
|
42+
LL - wtf: Some(Box(U {
43+
LL - wtf: None,
44+
LL - x: (),
45+
LL - })),
46+
LL + wtf: Some(Box::new(_)),
47+
|
48+
LL - wtf: Some(Box(U {
49+
LL - wtf: None,
50+
LL - x: (),
51+
LL - })),
52+
LL + wtf: Some(Box::new_uninit()),
53+
|
54+
LL - wtf: Some(Box(U {
55+
LL - wtf: None,
56+
LL - x: (),
57+
LL - })),
58+
LL + wtf: Some(Box::new_zeroed()),
59+
|
60+
LL - wtf: Some(Box(U {
61+
LL - wtf: None,
62+
LL - x: (),
63+
LL - })),
64+
LL + wtf: Some(Box::new_in(_, _)),
65+
|
66+
and 12 other candidates
67+
help: consider using the `Default` trait
68+
|
69+
LL - wtf: Some(Box(U {
70+
LL + wtf: Some(<Box as std::default::Default>::default()),
71+
|
72+
73+
error: cannot construct `HashMap<_, _, _>` with struct literal syntax due to private fields
74+
--> $DIR/multi-suggestion.rs:19:13
75+
|
76+
LL | let _ = std::collections::HashMap {};
77+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
78+
|
79+
= note: private field `base` that was not provided
80+
help: you might have meant to use an associated function to build this type
81+
|
82+
LL - let _ = std::collections::HashMap {};
83+
LL + let _ = std::collections::HashMap::new();
84+
|
85+
LL - let _ = std::collections::HashMap {};
86+
LL + let _ = std::collections::HashMap::with_capacity(_);
87+
|
88+
LL - let _ = std::collections::HashMap {};
89+
LL + let _ = std::collections::HashMap::with_hasher(_);
90+
|
91+
LL - let _ = std::collections::HashMap {};
92+
LL + let _ = std::collections::HashMap::with_capacity_and_hasher(_, _);
93+
|
94+
help: consider using the `Default` trait
95+
|
96+
LL - let _ = std::collections::HashMap {};
97+
LL + let _ = <std::collections::HashMap as std::default::Default>::default();
98+
|
99+
100+
error: cannot construct `Box<_, _>` with struct literal syntax due to private fields
101+
--> $DIR/multi-suggestion.rs:21:13
102+
|
103+
LL | let _ = Box {};
104+
| ^^^
105+
|
106+
= note: private fields `0` and `1` that were not provided
107+
help: you might have meant to use an associated function to build this type
108+
|
109+
LL - let _ = Box {};
110+
LL + let _ = Box::new(_);
111+
|
112+
LL - let _ = Box {};
113+
LL + let _ = Box::new_uninit();
114+
|
115+
LL - let _ = Box {};
116+
LL + let _ = Box::new_zeroed();
117+
|
118+
LL - let _ = Box {};
119+
LL + let _ = Box::new_in(_, _);
120+
|
121+
and 12 other candidates
122+
help: consider using the `Default` trait
123+
|
124+
LL - let _ = Box {};
125+
LL + let _ = <Box as std::default::Default>::default();
126+
|
127+
128+
error: aborting due to 4 previous errors
129+
130+
For more information about this error, try `rustc --explain E0423`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ revisions: ascii unicode
2+
//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode
3+
4+
#![allow(dead_code)]
5+
struct U <T> {
6+
wtf: Option<Box<U<T>>>,
7+
x: T,
8+
}
9+
fn main() {
10+
U {
11+
wtf: Some(Box(U { //[ascii]~ ERROR cannot initialize a tuple struct which contains private fields
12+
wtf: None,
13+
x: (),
14+
})),
15+
x: ()
16+
};
17+
let _ = std::collections::HashMap();
18+
//[ascii]~^ ERROR expected function, tuple struct or tuple variant, found struct `std::collections::HashMap`
19+
let _ = std::collections::HashMap {};
20+
//[ascii]~^ ERROR cannot construct `HashMap<_, _, _>` with struct literal syntax due to private fields
21+
let _ = Box {}; //[ascii]~ ERROR cannot construct `Box<_, _>` with struct literal syntax due to private fields
22+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
error[E0423]: expected function, tuple struct or tuple variant, found struct `std::collections::HashMap`
2+
╭▸ $DIR/multi-suggestion.rs:17:13
3+
4+
LL │ let _ = std::collections::HashMap();
5+
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━
6+
╭▸ $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
7+
8+
╰ note: `std::collections::HashMap` defined here
9+
╰╴
10+
help: you might have meant to use an associated function to build this type
11+
╭╴
12+
LL │ let _ = std::collections::HashMap::new();
13+
├╴ +++++
14+
LL - let _ = std::collections::HashMap();
15+
LL + let _ = std::collections::HashMap::with_capacity(_);
16+
├╴
17+
LL - let _ = std::collections::HashMap();
18+
LL + let _ = std::collections::HashMap::with_hasher(_);
19+
├╴
20+
LL - let _ = std::collections::HashMap();
21+
LL + let _ = std::collections::HashMap::with_capacity_and_hasher(_, _);
22+
╰╴
23+
help: consider using the `Default` trait
24+
╭╴
25+
LL │ let _ = <std::collections::HashMap as std::default::Default>::default();
26+
╰╴ + ++++++++++++++++++++++++++++++++++
27+
28+
error[E0423]: cannot initialize a tuple struct which contains private fields
29+
╭▸ $DIR/multi-suggestion.rs:11:19
30+
31+
LL │ wtf: Some(Box(U {
32+
│ ━━━
33+
╰╴
34+
note: constructor is not visible here due to private fields
35+
╭▸ $SRC_DIR/alloc/src/boxed.rs:LL:COL
36+
37+
╰ note: private field
38+
39+
╰ note: private field
40+
help: you might have meant to use an associated function to build this type
41+
╭╴
42+
LL - wtf: Some(Box(U {
43+
LL - wtf: None,
44+
LL - x: (),
45+
LL - })),
46+
LL + wtf: Some(Box::new(_)),
47+
├╴
48+
LL - wtf: Some(Box(U {
49+
LL - wtf: None,
50+
LL - x: (),
51+
LL - })),
52+
LL + wtf: Some(Box::new_uninit()),
53+
├╴
54+
LL - wtf: Some(Box(U {
55+
LL - wtf: None,
56+
LL - x: (),
57+
LL - })),
58+
LL + wtf: Some(Box::new_zeroed()),
59+
├╴
60+
LL - wtf: Some(Box(U {
61+
LL - wtf: None,
62+
LL - x: (),
63+
LL - })),
64+
LL + wtf: Some(Box::new_in(_, _)),
65+
╰╴
66+
and 12 other candidates
67+
help: consider using the `Default` trait
68+
╭╴
69+
LL - wtf: Some(Box(U {
70+
LL + wtf: Some(<Box as std::default::Default>::default()),
71+
╰╴
72+
73+
error: cannot construct `HashMap<_, _, _>` with struct literal syntax due to private fields
74+
╭▸ $DIR/multi-suggestion.rs:19:13
75+
76+
LL │ let _ = std::collections::HashMap {};
77+
│ ━━━━━━━━━━━━━━━━━━━━━━━━━
78+
79+
╰ note: private field `base` that was not provided
80+
help: you might have meant to use an associated function to build this type
81+
╭╴
82+
LL - let _ = std::collections::HashMap {};
83+
LL + let _ = std::collections::HashMap::new();
84+
├╴
85+
LL - let _ = std::collections::HashMap {};
86+
LL + let _ = std::collections::HashMap::with_capacity(_);
87+
├╴
88+
LL - let _ = std::collections::HashMap {};
89+
LL + let _ = std::collections::HashMap::with_hasher(_);
90+
├╴
91+
LL - let _ = std::collections::HashMap {};
92+
LL + let _ = std::collections::HashMap::with_capacity_and_hasher(_, _);
93+
╰╴
94+
help: consider using the `Default` trait
95+
╭╴
96+
LL - let _ = std::collections::HashMap {};
97+
LL + let _ = <std::collections::HashMap as std::default::Default>::default();
98+
╰╴
99+
100+
error: cannot construct `Box<_, _>` with struct literal syntax due to private fields
101+
╭▸ $DIR/multi-suggestion.rs:21:13
102+
103+
LL │ let _ = Box {};
104+
│ ━━━
105+
106+
╰ note: private fields `0` and `1` that were not provided
107+
help: you might have meant to use an associated function to build this type
108+
╭╴
109+
LL - let _ = Box {};
110+
LL + let _ = Box::new(_);
111+
├╴
112+
LL - let _ = Box {};
113+
LL + let _ = Box::new_uninit();
114+
├╴
115+
LL - let _ = Box {};
116+
LL + let _ = Box::new_zeroed();
117+
├╴
118+
LL - let _ = Box {};
119+
LL + let _ = Box::new_in(_, _);
120+
╰╴
121+
and 12 other candidates
122+
help: consider using the `Default` trait
123+
╭╴
124+
LL - let _ = Box {};
125+
LL + let _ = <Box as std::default::Default>::default();
126+
╰╴
127+
128+
error: aborting due to 4 previous errors
129+
130+
For more information about this error, try `rustc --explain E0423`.

0 commit comments

Comments
 (0)