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