Skip to content

Commit fd3f231

Browse files
committed
Fix test after rebase
1 parent 378e73e commit fd3f231

File tree

6 files changed

+31
-59
lines changed

6 files changed

+31
-59
lines changed

src/libsyntax/parse/attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl<'a> Parser<'a> {
235235
}
236236

237237
let lo = self.span;
238-
let ident = self.parse_ident_attr()?;
238+
let ident = self.parse_ident()?;
239239
let node = self.parse_meta_item_kind()?;
240240
Ok(ast::MetaItem { name: ident.name, node: node, span: lo.to(self.prev_span) })
241241
}

src/libsyntax/parse/parser.rs

-4
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,6 @@ impl<'a> Parser<'a> {
777777
self.parse_ident_common(true)
778778
}
779779

780-
pub fn parse_ident_attr(&mut self) -> PResult<'a, ast::Ident> {
781-
self.parse_ident()
782-
}
783-
784780
fn parse_ident_common(&mut self, recover: bool) -> PResult<'a, ast::Ident> {
785781
match self.token {
786782
token::Ident(i) => {

src/test/ui/mismatched_types/closure-arg-count.stderr

+29-21
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
1414
| |
1515
| expected closure that takes 2 arguments
1616

17-
error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
17+
error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument
1818
--> $DIR/closure-arg-count.rs:19:15
1919
|
2020
19 | [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
@@ -39,9 +39,9 @@ help: change the closure to take multiple arguments instead of a single tuple
3939
| ^^^^^^^^^^^^^^^
4040

4141
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
42-
--> $DIR/closure-arg-count.rs:21:5
42+
--> $DIR/closure-arg-count.rs:23:5
4343
|
44-
21 | f(|| panic!());
44+
23 | f(|| panic!());
4545
| ^ -- takes 0 arguments
4646
| |
4747
| expected closure that takes 1 argument
@@ -52,45 +52,53 @@ note: required by `f`
5252
13 | fn f<F: Fn<usize>>(_: F) {}
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^
5454

55-
error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
56-
--> $DIR/closure-arg-count.rs:24:53
55+
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
56+
--> $DIR/closure-arg-count.rs:26:53
5757
|
58-
24 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
59-
| ^^^ ------ help: consider changing the closure to accept a tuple: `|(i, x)|`
58+
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
59+
| ^^^ ------ takes 2 distinct arguments
6060
| |
61-
| expected closure that takes a single tuple as argument
61+
| expected closure that takes a single 2-tuple as argument
62+
help: change the closure to accept a tuple instead of individual arguments
63+
|
64+
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
65+
| ^^^^^^^^
6266

63-
error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
64-
--> $DIR/closure-arg-count.rs:26:53
67+
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
68+
--> $DIR/closure-arg-count.rs:28:53
6569
|
66-
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
67-
| ^^^ ------------- help: consider changing the closure to accept a tuple: `|(i, x): (usize, _)|`
70+
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
71+
| ^^^ ------------- takes 2 distinct arguments
6872
| |
69-
| expected closure that takes a single tuple as argument
73+
| expected closure that takes a single 2-tuple as argument
74+
help: change the closure to accept a tuple instead of individual arguments
75+
|
76+
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
77+
| ^^^^^^^^
7078

7179
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
72-
--> $DIR/closure-arg-count.rs:28:53
80+
--> $DIR/closure-arg-count.rs:30:53
7381
|
74-
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
82+
30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
7583
| ^^^ --------- takes 3 distinct arguments
7684
| |
7785
| expected closure that takes a single 2-tuple as argument
7886

7987
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
80-
--> $DIR/closure-arg-count.rs:30:53
88+
--> $DIR/closure-arg-count.rs:32:53
8189
|
82-
30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
90+
32 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
8391
| ^^^ expected function that takes a single 2-tuple as argument
8492
...
85-
37 | fn foo() {}
93+
41 | fn foo() {}
8694
| -------- takes 0 arguments
8795

8896
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
89-
--> $DIR/closure-arg-count.rs:33:53
97+
--> $DIR/closure-arg-count.rs:35:53
9098
|
91-
32 | let bar = |i, x, y| i;
99+
34 | let bar = |i, x, y| i;
92100
| --------- takes 3 distinct arguments
93-
33 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
101+
35 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
94102
| ^^^ expected closure that takes a single 2-tuple as argument
95103

96104
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments

src/test/ui/suggestions/for-c-in-str.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `&str: std::iter::Iterator` is not satisfied
22
--> $DIR/for-c-in-str.rs:14:14
33
|
44
14 | for c in "asdf" {
5-
| ^^^^^^ `&str` is not an iterator; maybe try calling `.iter()` or a similar method
5+
| ^^^^^^ `&str` is not an iterator; try calling `.chars()` or `.bytes()`
66
|
77
= help: the trait `std::iter::Iterator` is not implemented for `&str`
88
= note: required by `std::iter::IntoIterator::into_iter`

src/test/ui/suggestions/iterate-str.rs

-19
This file was deleted.

src/test/ui/suggestions/iterate-str.stderr

-13
This file was deleted.

0 commit comments

Comments
 (0)