let _: &[i32] = [0];
//~^ ERROR mismatched types
//~| expected type `&[i32]`
- //~| found type `[{integer}; 1]`
//~| expected &[i32], found array of 1 elements
}
let _y: &Trait = x; //~ ERROR mismatched types
//~| expected type `&Trait`
//~| found type `std::boxed::Box<Trait>`
+ //~| expected &Trait, found box
+ //~| ERROR the trait bound `Box<Trait>: Trait` is not satisfied
}
let x: *const S = &S;
let y: &S = x; //~ ERROR mismatched types
let y: &T = x; //~ ERROR mismatched types
+ //~^ ERROR the trait bound `*const S: T` is not satisfied
// Test that we cannot convert from *-ptr to &S and &T (mut version)
let x: *mut S = &mut S;
let y: &S = x; //~ ERROR mismatched types
let y: &T = x; //~ ERROR mismatched types
+ //~^ ERROR the trait bound `*mut S: T` is not satisfied
// Test that we cannot convert an immutable ptr to a mutable one using *-ptrs
let x: &mut T = &S; //~ ERROR mismatched types