mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-16 16:23:27 +00:00
19 lines
514 B
Rust
19 lines
514 B
Rust
//@ check-fail
|
|
fn main() {
|
|
let x = Box::new(Some(1));
|
|
|
|
let test: Option<i32> = x;
|
|
//~^ ERROR mismatched types
|
|
let x = Box::new(Some(1));
|
|
let test: Option<i32> = { x as Box<Option<i32>> };
|
|
//~^ ERROR mismatched types
|
|
|
|
let x = Box::new(Some(1));
|
|
let test: Option<i32> = if true { x as Box<Option<i32>> } else { None };
|
|
//~^ ERROR mismatched types
|
|
|
|
let x = std::rc::Rc::new(Some(1));
|
|
let test: Option<i32> = x as std::rc::Rc<Option<i32>>;
|
|
//~^ ERROR mismatched types
|
|
}
|