Require extern "Rust" fn main() exactly
This commit is contained in:
parent
b727b9efd7
commit
31114acdd7
5 changed files with 27 additions and 15 deletions
|
|
@ -8,6 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:expected `fn()
|
||||
|
||||
fn main(x: int) { }
|
||||
fn main(x: int) { } //~ ERROR: main function expects type
|
||||
|
|
|
|||
11
src/test/compile-fail/extern-main-fn.rs
Normal file
11
src/test/compile-fail/extern-main-fn.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern fn main() {} //~ ERROR: main function expects type
|
||||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() -> char {
|
||||
//~^ ERROR Wrong type in main function: found `extern "Rust" fn() -> char`
|
||||
//~^ ERROR: main function expects type
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ struct S {
|
|||
}
|
||||
|
||||
fn main(foo: S) {
|
||||
//~^ ERROR Wrong type in main function: found `extern "Rust" fn(S)`
|
||||
//~^ ERROR: main function expects type
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue