mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
23 lines
770 B
Rust
23 lines
770 B
Rust
fn main() {}
|
|
|
|
fn syntax() {
|
|
fn foo() = 42; //~ ERROR function body cannot be `= expression;`
|
|
fn bar() -> u8 = 42; //~ ERROR function body cannot be `= expression;`
|
|
}
|
|
|
|
extern "C" {
|
|
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;`
|
|
}
|