about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorSuchith J N <suchithjn@localhost.localdomain>2017-04-15 10:14:09 +0530
committerSuchith J N <suchithjn@localhost.localdomain>2017-04-15 10:14:09 +0530
commit65fafd9414915fe33bc69fb4bfefa8629b5e42ea (patch)
tree0abf71ed1a22b52a266cb88d357baa686a520d16 /src/test
parent4f32e0dfb287c2b3d0c48cb3b8090b3902960084 (diff)
downloadrust-65fafd9414915fe33bc69fb4bfefa8629b5e42ea.tar.gz
rust-65fafd9414915fe33bc69fb4bfefa8629b5e42ea.zip
[41272] - code for desugaring iflet changed
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-41272.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-41272.rs b/src/test/run-pass/issue-41272.rs
new file mode 100644
index 00000000000..154aa5b8cbe
--- /dev/null
+++ b/src/test/run-pass/issue-41272.rs
@@ -0,0 +1,13 @@
+struct Foo;
+
+impl Foo {
+    fn bar(&mut self) -> bool { true }
+}
+
+/* This causes E0301. By fixing issue #41272 this problem should vanish */
+fn iflet_issue(foo: &mut Foo) {
+    if let Some(_) = Some(true) {
+    } else if foo.bar() {}
+}
+
+fn main() {}