diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2016-09-12 01:53:43 +0300 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2016-09-12 01:53:43 +0300 |
| commit | f1bd90778997865480fa666fbf2eef1b164a0f72 (patch) | |
| tree | b5dfbf27575726cee4b62c5dfe03f0ddaa6d77a5 /src/test | |
| parent | 1fca1ab0e7be574022b2d229f0a6ad9bd580d1bf (diff) | |
| download | rust-f1bd90778997865480fa666fbf2eef1b164a0f72.tar.gz rust-f1bd90778997865480fa666fbf2eef1b164a0f72.zip | |
use `adt::trans_const` when translating constant closures and tuples
Fixes #36401
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/issue-36401.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-36401.rs b/src/test/run-pass/issue-36401.rs new file mode 100644 index 00000000000..7b08eba9e49 --- /dev/null +++ b/src/test/run-pass/issue-36401.rs @@ -0,0 +1,25 @@ +// Copyright 2016 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. + +#[derive(Debug)] +pub enum Event { + Key(u8), + Resize, + Unknown(u16), +} + +static XTERM_SINGLE_BYTES : [(u8, Event); 1] = [(1, Event::Resize)]; + +fn main() { + match XTERM_SINGLE_BYTES[0] { + (1, Event::Resize) => {}, + ref bad => panic!("unexpected {:?}", bad) + } +} |
