diff options
| author | bors <bors@rust-lang.org> | 2018-06-25 11:36:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-25 11:36:13 +0000 |
| commit | ecfe37056fa2abc79a4b97ff1c651fae47f66845 (patch) | |
| tree | 60283817562185e9feb4db4448003e81618c8f07 /src/test | |
| parent | 446aef691e7223f31b18236fb9bf2d08bc25ba46 (diff) | |
| parent | e14e48bfaa36bda05a467dca0743dab5b10de097 (diff) | |
| download | rust-ecfe37056fa2abc79a4b97ff1c651fae47f66845.tar.gz rust-ecfe37056fa2abc79a4b97ff1c651fae47f66845.zip | |
Auto merge of #51733 - varkor:ice-match-slice, r=oli-obk
Fix an ICE when matching over const slices Fixes #51655. I'm not super familiar with this code, so tell me if this is the wrong approach 😅 r? @oli-obk
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/issue-51655.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-51655.rs b/src/test/run-pass/issue-51655.rs new file mode 100644 index 00000000000..b5b89ede91b --- /dev/null +++ b/src/test/run-pass/issue-51655.rs @@ -0,0 +1,23 @@ +// 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. + +#![allow(dead_code)] + +const PATH_DOT: &[u8] = &[b'.']; + +fn match_slice(element: &[u8]) { + match element { + &[] => {} + PATH_DOT => {} + _ => {} + } +} + +fn main() {} |
