rust/tests/ui/parser/fn-body-eq-expr-semi.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
770 B
Rust
Raw Normal View History

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;`
}