2020-03-05 02:08:09 -06: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 16:12:52 -05:00
|
|
|
extern "C" {
|
2020-03-05 02:08:09 -06: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;`
|
|
|
|
}
|