]> git.lizzy.rs Git - rust.git/blob - src/test/ui/for-c-in-str.rs
Implement existential types
[rust.git] / src / test / ui / for-c-in-str.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // E0277 should point exclusively at line 14, not the entire for loop span
12
13 fn main() {
14     for c in "asdf" {
15     //~^ ERROR the trait bound `&str: std::iter::Iterator` is not satisfied
16     //~| NOTE `&str` is not an iterator
17     //~| HELP the trait `std::iter::Iterator` is not implemented for `&str`
18     //~| NOTE required by `std::iter::IntoIterator::into_iter`
19         println!("");
20     }
21 }