mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
30 lines
389 B
Rust
30 lines
389 B
Rust
// run-rustfix
|
|
#![allow(dead_code)]
|
|
|
|
struct Foo {
|
|
t: Thing
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
struct Thing;
|
|
|
|
fn test_clone() {
|
|
let t = &Thing;
|
|
let _f = Foo {
|
|
t: t.clone() //~ ERROR mismatched types
|
|
};
|
|
}
|
|
|
|
struct Bar {
|
|
t: bool
|
|
}
|
|
|
|
fn test_is_some() {
|
|
let t = Option::<i32>::Some(1);
|
|
let _f = Bar {
|
|
t: t.is_some() //~ ERROR mismatched types
|
|
};
|
|
}
|
|
|
|
fn main() {}
|