2024-02-16 20:02:50 +00:00
|
|
|
//@ run-rustfix
|
2023-08-04 17:22:20 +00:00
|
|
|
#![allow(dead_code, unused_variables, path_statements)]
|
|
|
|
fn a() {
|
|
|
|
let x = 5;
|
|
|
|
let y = x; //~ ERROR expected function
|
|
|
|
(); //~ ERROR expected `;`, found `}`
|
|
|
|
}
|
|
|
|
|
|
|
|
fn b() {
|
|
|
|
let x = 5;
|
|
|
|
let y = x; //~ ERROR expected function
|
|
|
|
();
|
|
|
|
}
|
|
|
|
fn c() {
|
|
|
|
let x = 5;
|
|
|
|
x; //~ ERROR expected function
|
|
|
|
()
|
|
|
|
}
|
|
|
|
fn d() { // ok
|
|
|
|
let x = || ();
|
|
|
|
x
|
|
|
|
()
|
|
|
|
}
|
|
|
|
fn e() { // ok
|
|
|
|
let x = || ();
|
|
|
|
x
|
|
|
|
();
|
|
|
|
}
|
|
|
|
fn f()
|
|
|
|
{
|
|
|
|
let y = 5; //~ ERROR expected function
|
|
|
|
(); //~ ERROR expected `;`, found `}`
|
|
|
|
}
|
|
|
|
fn g() {
|
|
|
|
5; //~ ERROR expected function
|
|
|
|
();
|
|
|
|
}
|
|
|
|
fn main() {}
|