summaryrefslogtreecommitdiffstats
path: root/src/test/pretty/for-comment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/pretty/for-comment.rs')
-rw-r--r--src/test/pretty/for-comment.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/pretty/for-comment.rs b/src/test/pretty/for-comment.rs
new file mode 100644
index 000000000..447e7f918
--- /dev/null
+++ b/src/test/pretty/for-comment.rs
@@ -0,0 +1,11 @@
+// compile-flags: --crate-type=lib
+
+// pp-exact
+
+fn f(v: &[isize]) -> isize {
+ let mut n = 0;
+ for e in v {
+ n = *e; // This comment once triggered pretty printer bug
+ }
+ n
+}