From caa564bea3d5f5a24d0797c4769184c1ea0abaff Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 21 Jul 2014 20:54:28 -0700 Subject: librustc: Stop desugaring `for` expressions and translate them directly. 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 { ... } } for x in MyStruct { ... } { ... } Change ad-hoc `next` methods like the above to implementations of the `Iterator` trait. For example: impl Iterator for MyStruct { fn next(&mut self) -> Option { ... } } Closes #15392. [breaking-change] --- src/libunicode/decompose.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libunicode') diff --git a/src/libunicode/decompose.rs b/src/libunicode/decompose.rs index 832b65d4739..25e06bf7c13 100644 --- a/src/libunicode/decompose.rs +++ b/src/libunicode/decompose.rs @@ -39,6 +39,7 @@ pub fn decompose_canonical(c: char, i: |char|) { d(c, i, false); } pub fn decompose_compatible(c: char, i: |char|) { d(c, i, true); } fn d(c: char, i: |char|, k: bool) { + #[cfg(stage0)] use core::iter::Iterator; // 7-bit ASCII never decomposes -- cgit 1.4.1-3-g733a5