2016-09-22 06:00:43 -05:00
|
|
|
struct Test<T: ?Sized>(T);
|
|
|
|
|
|
|
|
fn main() {
|
2022-06-20 17:30:34 -05:00
|
|
|
let x = Test([1, 2, 3]);
|
|
|
|
let x: &Test<[i32]> = &x;
|
2016-09-22 06:00:43 -05:00
|
|
|
|
2022-06-20 17:30:34 -05:00
|
|
|
let &ref _y = x;
|
2016-09-22 06:00:43 -05:00
|
|
|
|
|
|
|
// Make sure binding to a fat pointer behind a reference
|
|
|
|
// still works
|
2022-06-20 17:30:34 -05:00
|
|
|
let slice = &[1, 2, 3];
|
2016-09-22 06:00:43 -05:00
|
|
|
let x = Test(&slice);
|
|
|
|
let Test(&_slice) = x;
|
|
|
|
}
|