diff options
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/issue-20261.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/issue-51116.rs | 24 | ||||
| -rw-r--r-- | src/test/ui/issue-51116.stderr | 14 |
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`. |
