Skip to content

Commit 380d917

Browse files
zhassan-awstedinski
authored andcommitted
Added test for rust-lang#357 (rust-lang#709)
1 parent 706a23e commit 380d917

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/test/rmc/SubSlice/subslice2_fixme.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
// * #c_type: unsigned_long_int
2828
// * value: 1
2929
//
30-
// Full support for subslice projection to be added in
31-
// https://github.com/model-checking/rmc/issues/357
30+
// This issue is captured in:
31+
// https://github.com/model-checking/rmc/issues/708
3232

3333
fn main() {
3434
let arr = [1, 2, 3];

src/test/rmc/SubSlice/subslice3.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0 OR MIT
3+
4+
fn main() {
5+
let slice = &[1, 2, 3][..];
6+
if let [head, tail @ ..] = slice {
7+
assert!(head == &slice[0]);
8+
assert!(tail == &slice[1..]);
9+
} else {
10+
unreachable!();
11+
}
12+
}

0 commit comments

Comments
 (0)