2019-11-22 12:45:49 -06:00
|
|
|
// Some type that is not copyable.
|
|
|
|
struct Bar;
|
|
|
|
|
|
|
|
const fn no_copy() -> Option<Bar> {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
|
|
|
const fn copy() -> u32 {
|
|
|
|
3
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _: [u32; 2] = [copy(); 2];
|
|
|
|
let _: [Option<Bar>; 2] = [no_copy(); 2];
|
2022-04-11 11:38:48 -05:00
|
|
|
//~^ ERROR the trait bound `Bar: Copy` is not satisfied
|
2019-11-22 12:45:49 -06:00
|
|
|
}
|