Fix test after rebase

This commit is contained in:
Esteban Küber 2018-02-01 14:16:53 -08:00
parent 378e73e6db
commit fd3f2312a7
6 changed files with 33 additions and 61 deletions

View file

@ -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) })
}

View file

@ -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) => {

View file

@ -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!());
@ -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
@ -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
|
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)|`
| |
| expected closure that takes a single tuple as argument
error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
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
|
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, _)|`
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 2-tuple as argument, but it takes 3 distinct arguments
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
|
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
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 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:30:53
|
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

View file

@ -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`

View file

@ -1,19 +0,0 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
for c in "foobarbaz" {
println!("{}", c);
}
//~^^^ ERROR the trait bound `&str: std::iter::Iterator` is not satisfied
//~| NOTE `&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`
}

View file

@ -1,13 +0,0 @@
error[E0277]: the trait bound `&str: std::iter::Iterator` is not satisfied
--> $DIR/iterate-str.rs:12:5
|
12 | / for c in "foobarbaz" {
13 | | println!("{}", c);
14 | | }
| |_____^ `&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`
error: aborting due to previous error