]> git.lizzy.rs Git - rust.git/commitdiff
Fix test after rebase
authorEsteban Küber <esteban@kuber.com.ar>
Thu, 1 Feb 2018 22:16:53 +0000 (14:16 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Thu, 1 Feb 2018 23:16:02 +0000 (15:16 -0800)
src/libsyntax/parse/attr.rs
src/libsyntax/parse/parser.rs
src/test/ui/mismatched_types/closure-arg-count.stderr
src/test/ui/suggestions/for-c-in-str.stderr
src/test/ui/suggestions/iterate-str.rs [deleted file]
src/test/ui/suggestions/iterate-str.stderr [deleted file]

index b01f479895b10d64afe608be036923dbfa3be067..053746b579dcb31508741c0711cee871698f3081 100644 (file)
@@ -235,7 +235,7 @@ pub fn parse_meta_item(&mut self) -> PResult<'a, ast::MetaItem> {
         }
 
         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) })
     }
index 9d573ea0e7c0311e88bb5f0822b941b67ae1f81f..4c61ab6bd7810143e5c4f316e30a9275d242c083 100644 (file)
@@ -777,10 +777,6 @@ pub fn parse_ident(&mut self) -> PResult<'a, ast::Ident> {
         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) => {
index 4e1523c79d2d401bef75ae12fd9c6821e72074a3..be00ee4d74e7eededd2590ec6468ed33a62e651d 100644 (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
+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
index 7a6dc9a504029fb44b5c7d23d74b92bf31dd0a29..88a7b1b49d62d693d85991972b00cbdbd377f030 100644 (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`
diff --git a/src/test/ui/suggestions/iterate-str.rs b/src/test/ui/suggestions/iterate-str.rs
deleted file mode 100644 (file)
index 1022491..0000000
+++ /dev/null
@@ -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`
-}
diff --git a/src/test/ui/suggestions/iterate-str.stderr b/src/test/ui/suggestions/iterate-str.stderr
deleted file mode 100644 (file)
index 59da6d7..0000000
+++ /dev/null
@@ -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
-