about summary refs log tree commit diff
path: root/src/test/run-pass
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2018-05-17 21:28:50 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-05-19 20:34:42 +0300
commit26aad254875464ff352a4e18d16f668b5bd9b7cb (patch)
tree82c41e684745a322d3a33156dd00016136a5ce45 /src/test/run-pass
parent072b0f617fdd2ccb3bc6dd08718acf9504b7ed3a (diff)
downloadrust-26aad254875464ff352a4e18d16f668b5bd9b7cb.tar.gz
rust-26aad254875464ff352a4e18d16f668b5bd9b7cb.zip
rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants".
Diffstat (limited to 'src/test/run-pass')
-rw-r--r--src/test/run-pass/issue-50689.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-50689.rs b/src/test/run-pass/issue-50689.rs
new file mode 100644
index 00000000000..d437b9d88f4
--- /dev/null
+++ b/src/test/run-pass/issue-50689.rs
@@ -0,0 +1,17 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum Foo {
+    Bar = (|x: i32| { }, 42).1,
+}
+
+fn main() {
+    assert_eq!(Foo::Bar as usize, 42);
+}