2020-03-05 09:08:09 +01:00
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
fn syntax() {
|
|
|
|
fn foo() = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
fn bar() -> u8 = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
}
|
|
|
|
|
2020-09-01 17:12:52 -04:00
|
|
|
extern "C" {
|
2020-03-05 09:08:09 +01:00
|
|
|
fn foo() = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
//~^ ERROR incorrect function inside `extern` block
|
|
|
|
fn bar() -> u8 = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
//~^ ERROR incorrect function inside `extern` block
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
fn foo() = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
fn bar() -> u8 = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo for () {
|
|
|
|
fn foo() = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
fn bar() -> u8 = 42; //~ ERROR function body cannot be `= expression;`
|
|
|
|
}
|