Skip to content

Commit 3424ede

Browse files
committed
Changed tests
1 parent 0b152c9 commit 3424ede

File tree

7 files changed

+303
-285
lines changed

7 files changed

+303
-285
lines changed

tests/ui/typeck/issue-75883.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub struct UI {}
55
impl UI {
66
pub fn run() -> Result<_> {
77
//~^ ERROR: enum takes 2 generic arguments but 1 generic argument was supplied
8+
//~| ERROR: enum takes 2 generic arguments but 1 generic argument was supplied
89
//~| ERROR: the placeholder `_` is not allowed within types on item signatures for return types
910
let mut ui = UI {};
1011
ui.interact();
@@ -14,6 +15,7 @@ impl UI {
1415

1516
pub fn interact(&mut self) -> Result<_> {
1617
//~^ ERROR: enum takes 2 generic arguments but 1 generic argument was supplied
18+
//~| ERROR: enum takes 2 generic arguments but 1 generic argument was supplied
1719
//~| ERROR: the placeholder `_` is not allowed within types on item signatures for return types
1820
unimplemented!();
1921
}

tests/ui/typeck/issue-75883.stderr

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | pub fn run() -> Result<_, E> {
1212
| +++
1313

1414
error[E0107]: enum takes 2 generic arguments but 1 generic argument was supplied
15-
--> $DIR/issue-75883.rs:15:35
15+
--> $DIR/issue-75883.rs:16:35
1616
|
1717
LL | pub fn interact(&mut self) -> Result<_> {
1818
| ^^^^^^ - supplied 1 generic argument
@@ -24,19 +24,47 @@ help: add missing generic argument
2424
LL | pub fn interact(&mut self) -> Result<_, E> {
2525
| +++
2626

27-
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
28-
--> $DIR/issue-75883.rs:15:42
27+
error[E0107]: enum takes 2 generic arguments but 1 generic argument was supplied
28+
--> $DIR/issue-75883.rs:6:21
2929
|
30-
LL | pub fn interact(&mut self) -> Result<_> {
31-
| ^ not allowed in type signatures
30+
LL | pub fn run() -> Result<_> {
31+
| ^^^^^^ - supplied 1 generic argument
32+
| |
33+
| expected 2 generic arguments
34+
|
35+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
36+
help: add missing generic argument
37+
|
38+
LL | pub fn run() -> Result<_, E> {
39+
| +++
3240

3341
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
3442
--> $DIR/issue-75883.rs:6:28
3543
|
3644
LL | pub fn run() -> Result<_> {
3745
| ^ not allowed in type signatures
3846

39-
error: aborting due to 4 previous errors
47+
error[E0107]: enum takes 2 generic arguments but 1 generic argument was supplied
48+
--> $DIR/issue-75883.rs:16:35
49+
|
50+
LL | pub fn interact(&mut self) -> Result<_> {
51+
| ^^^^^^ - supplied 1 generic argument
52+
| |
53+
| expected 2 generic arguments
54+
|
55+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
56+
help: add missing generic argument
57+
|
58+
LL | pub fn interact(&mut self) -> Result<_, E> {
59+
| +++
60+
61+
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
62+
--> $DIR/issue-75883.rs:16:42
63+
|
64+
LL | pub fn interact(&mut self) -> Result<_> {
65+
| ^ not allowed in type signatures
66+
67+
error: aborting due to 6 previous errors
4068

4169
Some errors have detailed explanations: E0107, E0121.
4270
For more information about an error, try `rustc --explain E0107`.

tests/ui/typeck/issue-80779.stderr

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
2+
--> $DIR/issue-80779.rs:5:29
3+
|
4+
LL | pub fn f<'a>(val: T<'a>) -> _ {
5+
| ^ not allowed in type signatures
6+
17
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
28
--> $DIR/issue-80779.rs:10:28
39
|
@@ -10,18 +16,6 @@ LL - pub fn g(_: T<'static>) -> _ {}
1016
LL + pub fn g(_: T<'static>) -> () {}
1117
|
1218

13-
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
14-
--> $DIR/issue-80779.rs:5:29
15-
|
16-
LL | pub fn f<'a>(val: T<'a>) -> _ {
17-
| ^ not allowed in type signatures
18-
|
19-
help: replace with the correct return type
20-
|
21-
LL - pub fn f<'a>(val: T<'a>) -> _ {
22-
LL + pub fn f<'a>(val: T<'a>) -> () {
23-
|
24-
2519
error: aborting due to 2 previous errors
2620

2721
For more information about this error, try `rustc --explain E0121`.

tests/ui/typeck/typeck_type_placeholder_item.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ impl Test9 {
4747
fn test11(x: &usize) -> &_ {
4848
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
4949
&x
50+
//~^ ERROR: `x` does not live long enough
5051
}
5152

5253
unsafe fn test12(x: *const usize) -> *const *const _ {
@@ -129,13 +130,15 @@ pub fn main() {
129130

130131
fn fn_test11(_: _) -> (_, _) { panic!() }
131132
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
133+
//~| ERROR the placeholder `_` is not allowed within types on item signatures for functions
132134
//~| ERROR type annotations needed
133135

134136
fn fn_test12(x: i32) -> (_, _) { (x, x) }
135137
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
136138

137139
fn fn_test13(x: _) -> (i32, _) { (x, x) }
138140
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
141+
//~| ERROR the placeholder `_` is not allowed within types on item signatures for functions
139142
}
140143

141144
trait T {
@@ -230,7 +233,6 @@ fn value() -> Option<&'static _> {
230233

231234
const _: Option<_> = map(value);
232235
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
233-
//~| ERROR cannot call non-const function `map::<u8>` in constants
234236

235237
fn evens_squared(n: usize) -> _ {
236238
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types

0 commit comments

Comments
 (0)