2014-06-13 19:09:12 -07:00
|
|
|
struct Foo {
|
2015-01-08 21:54:35 +11:00
|
|
|
x: isize,
|
2014-06-13 19:09:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn hi(&self) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-04-14 17:09:03 -07:00
|
|
|
if Foo { //~ ERROR struct literals are not allowed here
|
|
|
|
x: 3
|
|
|
|
}.hi() {
|
2014-06-13 19:09:12 -07:00
|
|
|
println!("yo");
|
|
|
|
}
|
2023-08-28 10:30:48 +01:00
|
|
|
if let true = Foo { //~ ERROR struct literals are not allowed here
|
|
|
|
x: 3
|
|
|
|
}.hi() {
|
|
|
|
println!("yo");
|
|
|
|
}
|
2014-06-13 19:09:12 -07:00
|
|
|
}
|