summary refs log tree commit diff
path: root/src/test/compile-fail/for-loop-bogosity.rs
AgeCommit message (Collapse)AuthorLines
2015-10-16deduplicate trait errors before they are displayedAriel Ben-Yehuda-3/+0
Because of type inference, duplicate obligations exist and cause duplicate errors. To avoid this, only display the first error for each (predicate,span). The inclusion of the span is somewhat bikesheddy, but *is* the more conservative option (it does not remove some instability, as duplicate obligations are ignored by `duplicate_set` under some inference conditions). Fixes #28098 cc #21528 (is it a dupe?)
2015-01-30fix testsJorge Aparicio-1/+4
2015-01-08Update compile fail tests to use isize.Huon Wilson-3/+3
2014-08-29Mention type of `for` exprs that don't implement Iterator.Huon Wilson-2/+1
This improves the error message by telling the user the exact type of `x` if it doesn't implement `Iterator` in `for ... in x {}`. Closes #16043.
2014-07-24librustc: Stop desugaring `for` expressions and translate them directly.Patrick Walton-0/+31
This makes edge cases in which the `Iterator` trait was not in scope and/or `Option` or its variants were not in scope work properly. This breaks code that looks like: struct MyStruct { ... } impl MyStruct { fn next(&mut self) -> Option<int> { ... } } for x in MyStruct { ... } { ... } Change ad-hoc `next` methods like the above to implementations of the `Iterator` trait. For example: impl Iterator<int> for MyStruct { fn next(&mut self) -> Option<int> { ... } } Closes #15392. [breaking-change]