From 26aad254875464ff352a4e18d16f668b5bd9b7cb Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 17 May 2018 21:28:50 +0300 Subject: rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants". --- src/test/run-pass/issue-50689.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/run-pass/issue-50689.rs (limited to 'src/test/run-pass') 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 or the MIT license +// , 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); +} -- cgit 1.4.1-3-g733a5