2024-02-16 14:02:50 -06:00
|
|
|
//@ run-rustfix
|
2023-03-19 12:41:48 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
struct Foo {
|
|
|
|
t: Thing
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct Thing;
|
|
|
|
|
|
|
|
fn test_clone() {
|
|
|
|
let t = &Thing;
|
|
|
|
let _f = Foo {
|
|
|
|
t //~ ERROR mismatched types
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar {
|
|
|
|
t: bool
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_is_some() {
|
|
|
|
let t = Option::<i32>::Some(1);
|
|
|
|
let _f = Bar {
|
|
|
|
t //~ ERROR mismatched types
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|