about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-19 00:56:21 +0000
committerbors <bors@rust-lang.org>2018-07-19 00:56:21 +0000
commit629d891499bca79aeb8ea079f756c566fdabbd3e (patch)
tree57437d0b26123c42852dd692743584fcb35a631d /src/test/ui
parent166795dda66ce8132e2686923704d6bdcb5c2bc3 (diff)
parentae9c550415f639791e83b4b058c69f2842a4ff5c (diff)
Auto merge of #52486 - kennytm:rollup, r=kennytm
Rollup of 13 pull requests

Successful merges:

 - #51628 (use checked write in `LineWriter` example)
 - #52116 (Handle array manually in str case conversion methods)
 - #52218 (Amend option.take examples)
 - #52418 (Do not use desugared ident when suggesting adding a type)
 - #52439 (Revert some changes from #51917 to fix custom libdir)
 - #52455 (Fix doc comment: use `?` instead of `.unwrap()`)
 - #52458 (rustc: Fix a suggestion for the `proc_macro` feature)
 - #52464 (Allow clippy to be installed with make install)
 - #52472 (rustc: Enable `use_extern_macros` in 2018 edition)
 - #52477 (Clarify short-circuiting behvaior of Iterator::zip.)
 - #52480 (Cleanup #24958)
 - #52487 (Don't build twice the sanitizers on Linux)
 - #52510 (rustdoc: remove FIXME about macro redirects)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/issue-20261.stderr2
-rw-r--r--src/test/ui/issue-51116.rs24
-rw-r--r--src/test/ui/issue-51116.stderr14
3 files changed, 39 insertions, 1 deletions
diff --git a/src/test/ui/issue-20261.stderr b/src/test/ui/issue-20261.stderr
index a4a2aec8969..a7a7ea7c69b 100644
--- a/src/test/ui/issue-20261.stderr
+++ b/src/test/ui/issue-20261.stderr
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
   --> $DIR/issue-20261.rs:14:11
    |
 LL |     for (ref i,) in [].iter() {
-   |         -------- consider giving `__next` a type
+   |                     --------- the element type for this iterator is not specified
 LL |         i.clone();
    |           ^^^^^ cannot infer type for `_`
    |
diff --git a/src/test/ui/issue-51116.rs b/src/test/ui/issue-51116.rs
new file mode 100644
index 00000000000..34217c6236c
--- /dev/null
+++ b/src/test/ui/issue-51116.rs
@@ -0,0 +1,24 @@
+// 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() {
+    let tiles = Default::default();
+    for row in &mut tiles {
+        for tile in row {
+            //~^ NOTE the element type for this iterator is not specified
+            *tile = 0;
+            //~^ ERROR type annotations needed
+            //~| NOTE cannot infer type for `_`
+            //~| NOTE type must be known at this point
+        }
+    }
+
+    let tiles: [[usize; 3]; 3] = tiles;
+}
diff --git a/src/test/ui/issue-51116.stderr b/src/test/ui/issue-51116.stderr
new file mode 100644
index 00000000000..0c38688340b
--- /dev/null
+++ b/src/test/ui/issue-51116.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+  --> $DIR/issue-51116.rs:16:13
+   |
+LL |         for tile in row {
+   |                     --- the element type for this iterator is not specified
+LL |             //~^ NOTE the element type for this iterator is not specified
+LL |             *tile = 0;
+   |             ^^^^^ cannot infer type for `_`
+   |
+   = note: type must be known at this point
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.