]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/pass/dst-irrefutable-bind.rs
Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24
[rust.git] / src / tools / miri / tests / pass / dst-irrefutable-bind.rs
1 struct Test<T: ?Sized>(T);
2
3 fn main() {
4     let x = Test([1, 2, 3]);
5     let x: &Test<[i32]> = &x;
6
7     let &ref _y = x;
8
9     // Make sure binding to a fat pointer behind a reference
10     // still works
11     let slice = &[1, 2, 3];
12     let x = Test(&slice);
13     let Test(&_slice) = x;
14 }