Skip to content

Commit

Permalink
Fix test after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Feb 1, 2018
1 parent 378e73e commit fd3f231
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/attr.rs
Expand Up @@ -235,7 +235,7 @@ impl<'a> Parser<'a> {
}

let lo = self.span;
let ident = self.parse_ident_attr()?;
let ident = self.parse_ident()?;
let node = self.parse_meta_item_kind()?;
Ok(ast::MetaItem { name: ident.name, node: node, span: lo.to(self.prev_span) })
}
Expand Down
4 changes: 0 additions & 4 deletions src/libsyntax/parse/parser.rs
Expand Up @@ -777,10 +777,6 @@ impl<'a> Parser<'a> {
self.parse_ident_common(true)
}

pub fn parse_ident_attr(&mut self) -> PResult<'a, ast::Ident> {
self.parse_ident()
}

fn parse_ident_common(&mut self, recover: bool) -> PResult<'a, ast::Ident> {
match self.token {
token::Ident(i) => {
Expand Down
50 changes: 29 additions & 21 deletions src/test/ui/mismatched_types/closure-arg-count.stderr
Expand Up @@ -14,7 +14,7 @@ error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
| |
| expected closure that takes 2 arguments

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

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

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

error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:26:53
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:28:53
|
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
| ^^^ ------------- help: consider changing the closure to accept a tuple: `|(i, x): (usize, _)|`
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
| ^^^ ------------- takes 2 distinct arguments
| |
| expected closure that takes a single tuple as argument
| expected closure that takes a single 2-tuple as argument
help: change the closure to accept a tuple instead of individual arguments
|
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
| ^^^^^^^^

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

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

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

error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/suggestions/for-c-in-str.stderr
Expand Up @@ -2,7 +2,7 @@ error[E0277]: the trait bound `&str: std::iter::Iterator` is not satisfied
--> $DIR/for-c-in-str.rs:14:14
|
14 | for c in "asdf" {
| ^^^^^^ `&str` is not an iterator; maybe try calling `.iter()` or a similar method
| ^^^^^^ `&str` is not an iterator; try calling `.chars()` or `.bytes()`
|
= help: the trait `std::iter::Iterator` is not implemented for `&str`
= note: required by `std::iter::IntoIterator::into_iter`
Expand Down
19 changes: 0 additions & 19 deletions src/test/ui/suggestions/iterate-str.rs

This file was deleted.

13 changes: 0 additions & 13 deletions src/test/ui/suggestions/iterate-str.stderr

This file was deleted.

0 comments on commit fd3f231

Please sign in to comment.