diff options
Diffstat (limited to 'src/test/ui/for/for-c-in-str.rs')
-rw-r--r-- | src/test/ui/for/for-c-in-str.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/for/for-c-in-str.rs b/src/test/ui/for/for-c-in-str.rs new file mode 100644 index 000000000..86a1c1a34 --- /dev/null +++ b/src/test/ui/for/for-c-in-str.rs @@ -0,0 +1,14 @@ +// E0277 should point exclusively at line 6, not the entire for loop span + +fn main() { + for c in "asdf" { + //~^ ERROR `&str` is not an iterator + //~| NOTE `&str` is not an iterator + //~| HELP the trait `Iterator` is not implemented for `&str` + //~| NOTE required because of the requirements on the impl of `IntoIterator` for `&str` + //~| NOTE in this expansion of desugaring of `for` loop + //~| NOTE in this expansion of desugaring of `for` loop + //~| NOTE in this expansion of desugaring of `for` loop + println!(); + } +} |