From 02c1d2ff52f872ea2c15f0892cdc56b356e59145 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 3 Jan 2014 15:30:54 -0800 Subject: [PATCH] test: Make all the run-pass tests use `pub fn main` --- src/test/run-pass/borrowck-assign-to-subfield.rs | 2 +- src/test/run-pass/borrowck-nested-calls.rs | 2 +- src/test/run-pass/builtin-superkinds-capabilities-xc.rs | 2 +- src/test/run-pass/builtin-superkinds-in-metadata.rs | 2 +- src/test/run-pass/cfg-macros-foo.rs | 2 +- src/test/run-pass/cfg-macros-notfoo.rs | 2 +- src/test/run-pass/cfg_inner_static.rs | 2 +- src/test/run-pass/cfgs-on-items.rs | 2 +- src/test/run-pass/conditional-debug-macro-off.rs | 2 +- src/test/run-pass/conditional-debug-macro-on.rs | 2 +- src/test/run-pass/const-cross-crate-const.rs | 2 +- src/test/run-pass/cross-crate-const-pat.rs | 2 +- src/test/run-pass/cross-crate-newtype-struct-pat.rs | 2 +- src/test/run-pass/deriving-global.rs | 2 +- src/test/run-pass/deriving-rand.rs | 2 +- src/test/run-pass/dupe-first-attr.rc | 2 +- src/test/run-pass/extern-calling-convention-test.rs | 2 +- src/test/run-pass/extern-fn-reachable.rs | 2 +- src/test/run-pass/extern-mod-ordering-exe.rs | 2 +- src/test/run-pass/issue-10626.rs | 2 +- src/test/run-pass/issue-10806.rs | 2 +- src/test/run-pass/issue-11085.rs | 2 +- src/test/run-pass/issue-11224.rs | 2 +- src/test/run-pass/issue-11225-1.rs | 2 +- src/test/run-pass/issue-11225-2.rs | 2 +- src/test/run-pass/issue-3290.rs | 2 +- src/test/run-pass/issue-3796.rs | 2 +- src/test/run-pass/issue-4208.rs | 2 +- src/test/run-pass/issue-4241.rs | 2 +- src/test/run-pass/issue-4252.rs | 2 +- src/test/run-pass/issue-4545.rs | 2 +- src/test/run-pass/issue-5950.rs | 2 +- src/test/run-pass/issue-6334.rs | 2 +- src/test/run-pass/issue-7178.rs | 2 +- src/test/run-pass/issue-8044.rs | 2 +- src/test/run-pass/issue-8259.rs | 2 +- src/test/run-pass/issue-8498.rs | 2 +- src/test/run-pass/issue-9188.rs | 2 +- src/test/run-pass/issue-9906.rs | 2 +- src/test/run-pass/issue-9968.rs | 2 +- src/test/run-pass/issue_9155.rs | 2 +- src/test/run-pass/linkage-visibility.rs | 2 +- src/test/run-pass/logging-enabled-debug.rs | 2 +- src/test/run-pass/logging-enabled.rs | 2 +- src/test/run-pass/logging-right-crate.rs | 2 +- src/test/run-pass/logging_before_rt_started.rs | 2 +- src/test/run-pass/macro-with-attrs1.rs | 2 +- src/test/run-pass/native-print-no-runtime.rs | 2 +- src/test/run-pass/no-std-xcrate.rs | 2 +- src/test/run-pass/no-std-xcrate2.rs | 2 +- src/test/run-pass/once-move-out-on-heap.rs | 2 +- src/test/run-pass/once-move-out-on-stack.rs | 2 +- src/test/run-pass/osx-frameworks.rs | 2 +- src/test/run-pass/packed-struct-size-xc.rs | 2 +- src/test/run-pass/priv-impl-prim-ty.rs | 2 +- src/test/run-pass/privacy-reexport.rs | 2 +- src/test/run-pass/reexport-should-still-link.rs | 2 +- src/test/run-pass/rename-directory.rs | 2 +- src/test/run-pass/signal-exit-status.rs | 2 +- src/test/run-pass/smallest-hello-world.rs | 2 +- src/test/run-pass/spawning-with-debug.rs | 2 +- src/test/run-pass/static-function-pointer-xc.rs | 2 +- src/test/run-pass/struct_variant_xc.rs | 2 +- src/test/run-pass/syntax-extension-cfg.rs | 2 +- src/test/run-pass/tempfile.rs | 2 +- src/test/run-pass/trait-bounds-in-arc.rs | 2 +- src/test/run-pass/trait-default-method-xc-2.rs | 2 +- src/test/run-pass/trait-default-method-xc.rs | 2 +- src/test/run-pass/tydesc-name.rs | 2 +- src/test/run-pass/typeid-intrinsic.rs | 2 +- src/test/run-pass/use_inline_dtor.rs | 2 +- src/test/run-pass/xcrate-address-insignificant.rs | 2 +- src/test/run-pass/xcrate-unit-struct.rs | 2 +- 73 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/test/run-pass/borrowck-assign-to-subfield.rs b/src/test/run-pass/borrowck-assign-to-subfield.rs index d388f070f8d..10b5825cdd6 100644 --- a/src/test/run-pass/borrowck-assign-to-subfield.rs +++ b/src/test/run-pass/borrowck-assign-to-subfield.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn main() { +pub fn main() { struct A { a: int, w: B, diff --git a/src/test/run-pass/borrowck-nested-calls.rs b/src/test/run-pass/borrowck-nested-calls.rs index 50e9b6d81b5..7402f087508 100644 --- a/src/test/run-pass/borrowck-nested-calls.rs +++ b/src/test/run-pass/borrowck-nested-calls.rs @@ -24,7 +24,7 @@ impl Foo { } } -fn main() { +pub fn main() { let mut f = Foo {a: 22, b: 23}; f.inc_a(f.next_b()); assert_eq!(f.a, 22+23); diff --git a/src/test/run-pass/builtin-superkinds-capabilities-xc.rs b/src/test/run-pass/builtin-superkinds-capabilities-xc.rs index f94d1af84f6..54c4e0dce8b 100644 --- a/src/test/run-pass/builtin-superkinds-capabilities-xc.rs +++ b/src/test/run-pass/builtin-superkinds-capabilities-xc.rs @@ -28,7 +28,7 @@ fn foo(val: T, chan: Chan) { chan.send(val); } -fn main() { +pub fn main() { let (p,c) = Chan::new(); foo(X(31337), c); assert!(p.recv() == X(31337)); diff --git a/src/test/run-pass/builtin-superkinds-in-metadata.rs b/src/test/run-pass/builtin-superkinds-in-metadata.rs index f285275f5e2..55edc135190 100644 --- a/src/test/run-pass/builtin-superkinds-in-metadata.rs +++ b/src/test/run-pass/builtin-superkinds-in-metadata.rs @@ -26,4 +26,4 @@ impl RequiresRequiresFreezeAndSend for X { } impl RequiresPod for X { } -fn main() { } +pub fn main() { } diff --git a/src/test/run-pass/cfg-macros-foo.rs b/src/test/run-pass/cfg-macros-foo.rs index 224df80d08e..49e36ca5c63 100644 --- a/src/test/run-pass/cfg-macros-foo.rs +++ b/src/test/run-pass/cfg-macros-foo.rs @@ -32,6 +32,6 @@ mod foo { } } -fn main() { +pub fn main() { assert!(bar!()) } diff --git a/src/test/run-pass/cfg-macros-notfoo.rs b/src/test/run-pass/cfg-macros-notfoo.rs index 5aa94bb1fbd..88244135ff7 100644 --- a/src/test/run-pass/cfg-macros-notfoo.rs +++ b/src/test/run-pass/cfg-macros-notfoo.rs @@ -32,6 +32,6 @@ mod foo { } } -fn main() { +pub fn main() { assert!(!bar!()) } diff --git a/src/test/run-pass/cfg_inner_static.rs b/src/test/run-pass/cfg_inner_static.rs index 2d06a10a05f..58f094c5987 100644 --- a/src/test/run-pass/cfg_inner_static.rs +++ b/src/test/run-pass/cfg_inner_static.rs @@ -13,6 +13,6 @@ extern mod cfg_inner_static; -fn main() { +pub fn main() { cfg_inner_static::foo(); } diff --git a/src/test/run-pass/cfgs-on-items.rs b/src/test/run-pass/cfgs-on-items.rs index 237fa3f7ea9..496770bc325 100644 --- a/src/test/run-pass/cfgs-on-items.rs +++ b/src/test/run-pass/cfgs-on-items.rs @@ -25,7 +25,7 @@ fn foo2() -> int { 2 } fn foo2() -> int { 3 } -fn main() { +pub fn main() { assert_eq!(1, foo1()); assert_eq!(3, foo2()); } diff --git a/src/test/run-pass/conditional-debug-macro-off.rs b/src/test/run-pass/conditional-debug-macro-off.rs index 1648b198999..54626f9ffff 100644 --- a/src/test/run-pass/conditional-debug-macro-off.rs +++ b/src/test/run-pass/conditional-debug-macro-off.rs @@ -12,7 +12,7 @@ // compile-flags: --cfg ndebug // exec-env:RUST_LOG=conditional-debug-macro-off=4 -fn main() { +pub fn main() { // only fails if debug! evaluates its argument. debug!("{:?}", { if true { fail!() } }); } diff --git a/src/test/run-pass/conditional-debug-macro-on.rs b/src/test/run-pass/conditional-debug-macro-on.rs index 3842d480327..0599d199dc0 100644 --- a/src/test/run-pass/conditional-debug-macro-on.rs +++ b/src/test/run-pass/conditional-debug-macro-on.rs @@ -11,7 +11,7 @@ // xfail-fast compile-flags directive doesn't work for check-fast // exec-env:RUST_LOG=conditional-debug-macro-on=4 -fn main() { +pub fn main() { // exits early if debug! evaluates its arguments, otherwise it // will hit the fail. debug!("{:?}", { if true { return; } }); diff --git a/src/test/run-pass/const-cross-crate-const.rs b/src/test/run-pass/const-cross-crate-const.rs index 607d0c72b89..9d85689d4ad 100644 --- a/src/test/run-pass/const-cross-crate-const.rs +++ b/src/test/run-pass/const-cross-crate-const.rs @@ -16,7 +16,7 @@ static foo: &'static str = cci_const::foopy; static a: uint = cci_const::uint_val; static b: uint = cci_const::uint_expr + 5; -fn main() { +pub fn main() { assert_eq!(a, 12); let foo2 = a; assert_eq!(foo2, cci_const::uint_val); diff --git a/src/test/run-pass/cross-crate-const-pat.rs b/src/test/run-pass/cross-crate-const-pat.rs index 0a0e2356f44..f6516d2b826 100644 --- a/src/test/run-pass/cross-crate-const-pat.rs +++ b/src/test/run-pass/cross-crate-const-pat.rs @@ -13,7 +13,7 @@ extern mod cci_const; -fn main() { +pub fn main() { let x = cci_const::uint_val; match x { cci_const::uint_val => {} diff --git a/src/test/run-pass/cross-crate-newtype-struct-pat.rs b/src/test/run-pass/cross-crate-newtype-struct-pat.rs index 37d5c5c700b..db767151bd4 100644 --- a/src/test/run-pass/cross-crate-newtype-struct-pat.rs +++ b/src/test/run-pass/cross-crate-newtype-struct-pat.rs @@ -13,7 +13,7 @@ extern mod newtype_struct_xc; -fn main() { +pub fn main() { let x = newtype_struct_xc::Au(21); match x { newtype_struct_xc::Au(n) => assert_eq!(n, 21) diff --git a/src/test/run-pass/deriving-global.rs b/src/test/run-pass/deriving-global.rs index 37487c1b6d7..ce51e2dcd70 100644 --- a/src/test/run-pass/deriving-global.rs +++ b/src/test/run-pass/deriving-global.rs @@ -39,4 +39,4 @@ mod submod { } -fn main() {} +pub fn main() {} diff --git a/src/test/run-pass/deriving-rand.rs b/src/test/run-pass/deriving-rand.rs index 9a28ed70088..58ef613b7cd 100644 --- a/src/test/run-pass/deriving-rand.rs +++ b/src/test/run-pass/deriving-rand.rs @@ -32,7 +32,7 @@ enum D { D2 { x: (), y: () } } -fn main() { +pub fn main() { // check there's no segfaults 20.times(|| { rand::random::(); diff --git a/src/test/run-pass/dupe-first-attr.rc b/src/test/run-pass/dupe-first-attr.rc index 9bd63a8d646..c3c22cb26d2 100644 --- a/src/test/run-pass/dupe-first-attr.rc +++ b/src/test/run-pass/dupe-first-attr.rc @@ -26,4 +26,4 @@ mod hello; #[cfg(target_os = "android")] mod hello; -fn main() { } \ No newline at end of file +pub fn main() { } diff --git a/src/test/run-pass/extern-calling-convention-test.rs b/src/test/run-pass/extern-calling-convention-test.rs index e8609a8b60b..5a5ed2e02c1 100644 --- a/src/test/run-pass/extern-calling-convention-test.rs +++ b/src/test/run-pass/extern-calling-convention-test.rs @@ -15,6 +15,6 @@ extern mod extern_calling_convention; use extern_calling_convention::foo; -fn main() { +pub fn main() { foo(1, 2, 3, 4); } diff --git a/src/test/run-pass/extern-fn-reachable.rs b/src/test/run-pass/extern-fn-reachable.rs index 7af832a7bac..c1af0c2b373 100644 --- a/src/test/run-pass/extern-fn-reachable.rs +++ b/src/test/run-pass/extern-fn-reachable.rs @@ -27,7 +27,7 @@ pub mod bar { #[no_mangle] pub fn fun5() {} -fn main() { +pub fn main() { unsafe { let a = DynamicLibrary::open(None).unwrap(); assert!(a.symbol::("fun1").is_ok()); diff --git a/src/test/run-pass/extern-mod-ordering-exe.rs b/src/test/run-pass/extern-mod-ordering-exe.rs index 5836245ff78..17731d9ec94 100644 --- a/src/test/run-pass/extern-mod-ordering-exe.rs +++ b/src/test/run-pass/extern-mod-ordering-exe.rs @@ -5,6 +5,6 @@ extern mod extern_mod_ordering_lib; use extern_mod_ordering_lib::extern_mod_ordering_lib; -fn main() { +pub fn main() { extern_mod_ordering_lib::f(); } diff --git a/src/test/run-pass/issue-10626.rs b/src/test/run-pass/issue-10626.rs index f6c0b73387d..020db44bb87 100644 --- a/src/test/run-pass/issue-10626.rs +++ b/src/test/run-pass/issue-10626.rs @@ -16,7 +16,7 @@ use std::os; use std::io::process; -fn main () { +pub fn main () { let args = os::args(); if args.len() > 1 && args[1] == ~"child" { for _ in range(0, 1000) { diff --git a/src/test/run-pass/issue-10806.rs b/src/test/run-pass/issue-10806.rs index 3ee3f30e00f..046b2884a0e 100644 --- a/src/test/run-pass/issue-10806.rs +++ b/src/test/run-pass/issue-10806.rs @@ -38,7 +38,7 @@ pub mod waldo { } } -fn main() { +pub fn main() { let _x = baz::quux(); let _y = grault::garply(); let _z = waldo::plugh(); diff --git a/src/test/run-pass/issue-11085.rs b/src/test/run-pass/issue-11085.rs index 9d7eab050d8..c0686d91fb9 100644 --- a/src/test/run-pass/issue-11085.rs +++ b/src/test/run-pass/issue-11085.rs @@ -43,7 +43,7 @@ enum Bar3 { } } -fn main() { +pub fn main() { let _f = Foo { foo: 3 }; let _f = Foo2 { foo: 3 }; diff --git a/src/test/run-pass/issue-11224.rs b/src/test/run-pass/issue-11224.rs index bf412ceab28..da92428f258 100644 --- a/src/test/run-pass/issue-11224.rs +++ b/src/test/run-pass/issue-11224.rs @@ -13,4 +13,4 @@ extern mod unused = "issue-11224"; -fn main() {} +pub fn main() {} diff --git a/src/test/run-pass/issue-11225-1.rs b/src/test/run-pass/issue-11225-1.rs index ad8cb1e79ab..d8724b5ba8d 100644 --- a/src/test/run-pass/issue-11225-1.rs +++ b/src/test/run-pass/issue-11225-1.rs @@ -13,6 +13,6 @@ extern mod foo = "issue-11225-1"; -fn main() { +pub fn main() { foo::foo(1); } diff --git a/src/test/run-pass/issue-11225-2.rs b/src/test/run-pass/issue-11225-2.rs index e572e56362b..86e4232880c 100644 --- a/src/test/run-pass/issue-11225-2.rs +++ b/src/test/run-pass/issue-11225-2.rs @@ -13,6 +13,6 @@ extern mod foo = "issue-11225-2"; -fn main() { +pub fn main() { foo::foo(1); } diff --git a/src/test/run-pass/issue-3290.rs b/src/test/run-pass/issue-3290.rs index 5cdc4238eaf..c6b48ad636f 100644 --- a/src/test/run-pass/issue-3290.rs +++ b/src/test/run-pass/issue-3290.rs @@ -9,7 +9,7 @@ // except according to those terms. // xfail-test FIXME #3290 -fn main() { +pub fn main() { let mut x = ~3; x = x; assert_eq!(*x, 3); diff --git a/src/test/run-pass/issue-3796.rs b/src/test/run-pass/issue-3796.rs index a7c6f86b453..df8820c5623 100644 --- a/src/test/run-pass/issue-3796.rs +++ b/src/test/run-pass/issue-3796.rs @@ -10,7 +10,7 @@ // xfail-test FIXME #3796 #[deny(dead_assignment)]; -fn main() { +pub fn main() { let mut x = 1; let f: || -> int = || { x + 20 }; assert_eq!(f(), 21); diff --git a/src/test/run-pass/issue-4208.rs b/src/test/run-pass/issue-4208.rs index 92b3f6274d5..4a4c263f938 100644 --- a/src/test/run-pass/issue-4208.rs +++ b/src/test/run-pass/issue-4208.rs @@ -16,4 +16,4 @@ use numeric::{sin, Angle}; fn foo>(theta: A) -> T { sin(&theta) } -fn main() {} +pub fn main() {} diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs index b53036d091f..7a09741acb1 100644 --- a/src/test/run-pass/issue-4241.rs +++ b/src/test/run-pass/issue-4241.rs @@ -127,5 +127,5 @@ fn query2(cmd: ~[~str]) -> Result { } -fn main() { +pub fn main() { } diff --git a/src/test/run-pass/issue-4252.rs b/src/test/run-pass/issue-4252.rs index c7ba345517c..9fd1a1c81eb 100644 --- a/src/test/run-pass/issue-4252.rs +++ b/src/test/run-pass/issue-4252.rs @@ -31,7 +31,7 @@ impl Drop for Z { } } -fn main() { +pub fn main() { let y = Y; let _z = Z{x: y}; } diff --git a/src/test/run-pass/issue-4545.rs b/src/test/run-pass/issue-4545.rs index dfee437ba35..6c018b5cd2f 100644 --- a/src/test/run-pass/issue-4545.rs +++ b/src/test/run-pass/issue-4545.rs @@ -12,4 +12,4 @@ // aux-build:issue-4545.rs extern mod somelib = "issue-4545"; -fn main() { somelib::mk::(); } +pub fn main() { somelib::mk::(); } diff --git a/src/test/run-pass/issue-5950.rs b/src/test/run-pass/issue-5950.rs index b169d2d4804..9cef8b5685f 100644 --- a/src/test/run-pass/issue-5950.rs +++ b/src/test/run-pass/issue-5950.rs @@ -14,4 +14,4 @@ pub use local_alias = local; mod local { } -fn main() {} +pub fn main() {} diff --git a/src/test/run-pass/issue-6334.rs b/src/test/run-pass/issue-6334.rs index 740a2212726..38934c6e763 100644 --- a/src/test/run-pass/issue-6334.rs +++ b/src/test/run-pass/issue-6334.rs @@ -48,7 +48,7 @@ fn use_c(s: &S, t: &T) -> uint { s.combine(t) } -fn main() { +pub fn main() { let foo = Foo; let bar = Bar; let r = use_c(&bar, &foo); diff --git a/src/test/run-pass/issue-7178.rs b/src/test/run-pass/issue-7178.rs index 3d635b87777..39afbd1c3ec 100644 --- a/src/test/run-pass/issue-7178.rs +++ b/src/test/run-pass/issue-7178.rs @@ -13,6 +13,6 @@ extern mod cross_crate_self = "issue-7178"; -fn main() { +pub fn main() { let _ = cross_crate_self::Foo::new(&1i); } diff --git a/src/test/run-pass/issue-8044.rs b/src/test/run-pass/issue-8044.rs index 15d490e98d6..5ad355dbd4c 100644 --- a/src/test/run-pass/issue-8044.rs +++ b/src/test/run-pass/issue-8044.rs @@ -14,6 +14,6 @@ extern mod minimal = "issue-8044"; use minimal::{BTree, leaf}; -fn main() { +pub fn main() { BTree:: { node: leaf(1) }; } diff --git a/src/test/run-pass/issue-8259.rs b/src/test/run-pass/issue-8259.rs index 3e9007b5e36..3533f336b42 100644 --- a/src/test/run-pass/issue-8259.rs +++ b/src/test/run-pass/issue-8259.rs @@ -14,4 +14,4 @@ extern mod other = "issue-8259"; static a: other::Foo<'static> = other::A; -fn main() {} +pub fn main() {} diff --git a/src/test/run-pass/issue-8498.rs b/src/test/run-pass/issue-8498.rs index 247b74e4643..fc7e24ccd7a 100644 --- a/src/test/run-pass/issue-8498.rs +++ b/src/test/run-pass/issue-8498.rs @@ -10,7 +10,7 @@ // xfail-test -fn main() { +pub fn main() { // This is ok match &[(~5,~7)] { ps => { diff --git a/src/test/run-pass/issue-9188.rs b/src/test/run-pass/issue-9188.rs index e3e09394bd6..d3455af4e2c 100644 --- a/src/test/run-pass/issue-9188.rs +++ b/src/test/run-pass/issue-9188.rs @@ -13,7 +13,7 @@ extern mod issue_9188; -fn main() { +pub fn main() { let a = issue_9188::bar(); let b = issue_9188::foo::(); assert_eq!(*a, *b); diff --git a/src/test/run-pass/issue-9906.rs b/src/test/run-pass/issue-9906.rs index e44374cb23a..6a604058663 100644 --- a/src/test/run-pass/issue-9906.rs +++ b/src/test/run-pass/issue-9906.rs @@ -13,7 +13,7 @@ extern mod testmod = "issue-9906"; -fn main() { +pub fn main() { testmod::foo(); testmod::FooBar::new(1); } diff --git a/src/test/run-pass/issue-9968.rs b/src/test/run-pass/issue-9968.rs index 4ea5aba91da..f23729537eb 100644 --- a/src/test/run-pass/issue-9968.rs +++ b/src/test/run-pass/issue-9968.rs @@ -15,7 +15,7 @@ extern mod lib = "issue-9968"; use lib::{Trait, Struct}; -fn main() +pub fn main() { Struct::init().test(); } diff --git a/src/test/run-pass/issue_9155.rs b/src/test/run-pass/issue_9155.rs index ae0bfe2babe..3fbdf57e348 100644 --- a/src/test/run-pass/issue_9155.rs +++ b/src/test/run-pass/issue_9155.rs @@ -15,6 +15,6 @@ extern mod issue_9155; struct Baz; -fn main() { +pub fn main() { issue_9155::Foo::new(Baz); } diff --git a/src/test/run-pass/linkage-visibility.rs b/src/test/run-pass/linkage-visibility.rs index 438fd21e810..bbfbdb1cdf0 100644 --- a/src/test/run-pass/linkage-visibility.rs +++ b/src/test/run-pass/linkage-visibility.rs @@ -15,7 +15,7 @@ extern mod foo = "linkage-visibility"; -fn main() { +pub fn main() { foo::test(); foo::foo2::(); foo::foo(); diff --git a/src/test/run-pass/logging-enabled-debug.rs b/src/test/run-pass/logging-enabled-debug.rs index 4bfdbc5563a..98fe46357ba 100644 --- a/src/test/run-pass/logging-enabled-debug.rs +++ b/src/test/run-pass/logging-enabled-debug.rs @@ -14,7 +14,7 @@ use std::logging; -fn main() { +pub fn main() { if log_enabled!(logging::DEBUG) { fail!("what?! debugging?"); } diff --git a/src/test/run-pass/logging-enabled.rs b/src/test/run-pass/logging-enabled.rs index 1fc38ac30c2..43f039569b2 100644 --- a/src/test/run-pass/logging-enabled.rs +++ b/src/test/run-pass/logging-enabled.rs @@ -13,7 +13,7 @@ use std::logging; -fn main() { +pub fn main() { if log_enabled!(logging::DEBUG) { fail!("what?! debugging?"); } diff --git a/src/test/run-pass/logging-right-crate.rs b/src/test/run-pass/logging-right-crate.rs index 21b45cec235..3e6978a6fa7 100644 --- a/src/test/run-pass/logging-right-crate.rs +++ b/src/test/run-pass/logging-right-crate.rs @@ -24,7 +24,7 @@ extern mod logging_right_crate; -fn main() { +pub fn main() { // this function fails if logging is turned on logging_right_crate::foo::(); } diff --git a/src/test/run-pass/logging_before_rt_started.rs b/src/test/run-pass/logging_before_rt_started.rs index 61d48c6800d..7bbe7f72a2c 100644 --- a/src/test/run-pass/logging_before_rt_started.rs +++ b/src/test/run-pass/logging_before_rt_started.rs @@ -17,4 +17,4 @@ // this test will trigger "output during runtime initialization" to make sure // that the bug isn't re-introduced. -fn main() {} +pub fn main() {} diff --git a/src/test/run-pass/macro-with-attrs1.rs b/src/test/run-pass/macro-with-attrs1.rs index 5a5091c3856..6d6d8f2cc21 100644 --- a/src/test/run-pass/macro-with-attrs1.rs +++ b/src/test/run-pass/macro-with-attrs1.rs @@ -19,6 +19,6 @@ macro_rules! foo( () => (1) ) #[cfg(not(foo))] macro_rules! foo( () => (2) ) -fn main() { +pub fn main() { assert_eq!(foo!(), 1); } diff --git a/src/test/run-pass/native-print-no-runtime.rs b/src/test/run-pass/native-print-no-runtime.rs index b468b53d2f7..7dbd895b476 100644 --- a/src/test/run-pass/native-print-no-runtime.rs +++ b/src/test/run-pass/native-print-no-runtime.rs @@ -13,7 +13,7 @@ #[no_uv]; #[start] -fn main(_: int, _: **u8) -> int { +pub fn main(_: int, _: **u8) -> int { println!("hello"); 0 } diff --git a/src/test/run-pass/no-std-xcrate.rs b/src/test/run-pass/no-std-xcrate.rs index f69f53cecd4..d4341ccf7dc 100644 --- a/src/test/run-pass/no-std-xcrate.rs +++ b/src/test/run-pass/no-std-xcrate.rs @@ -16,6 +16,6 @@ extern mod no_std_crate; -fn main() { +pub fn main() { no_std_crate::foo(); } diff --git a/src/test/run-pass/no-std-xcrate2.rs b/src/test/run-pass/no-std-xcrate2.rs index e393eb3a5c9..f164d8609fc 100644 --- a/src/test/run-pass/no-std-xcrate2.rs +++ b/src/test/run-pass/no-std-xcrate2.rs @@ -29,7 +29,7 @@ pub mod linkhack { } #[start] -fn main(_: int, _: **u8, _: *u8) -> int { +pub fn main(_: int, _: **u8, _: *u8) -> int { no_std_crate::foo(); 0 } diff --git a/src/test/run-pass/once-move-out-on-heap.rs b/src/test/run-pass/once-move-out-on-heap.rs index 4b09506b65f..8c3f889c176 100644 --- a/src/test/run-pass/once-move-out-on-heap.rs +++ b/src/test/run-pass/once-move-out-on-heap.rs @@ -20,7 +20,7 @@ fn foo(blk: proc()) { blk(); } -fn main() { +pub fn main() { let x = arc::Arc::new(true); do foo { assert!(*x.get()); diff --git a/src/test/run-pass/once-move-out-on-stack.rs b/src/test/run-pass/once-move-out-on-stack.rs index c7b2cc6124b..07dd5175a0f 100644 --- a/src/test/run-pass/once-move-out-on-stack.rs +++ b/src/test/run-pass/once-move-out-on-stack.rs @@ -20,7 +20,7 @@ fn foo(blk: once ||) { blk(); } -fn main() { +pub fn main() { let x = arc::Arc::new(true); foo(|| { assert!(*x.get()); diff --git a/src/test/run-pass/osx-frameworks.rs b/src/test/run-pass/osx-frameworks.rs index cfb7a8e43be..5e45386353b 100644 --- a/src/test/run-pass/osx-frameworks.rs +++ b/src/test/run-pass/osx-frameworks.rs @@ -17,7 +17,7 @@ extern { } #[cfg(target_os = "macos")] -fn main() { +pub fn main() { unsafe { CFRunLoopGetTypeID(); } } diff --git a/src/test/run-pass/packed-struct-size-xc.rs b/src/test/run-pass/packed-struct-size-xc.rs index 5b4426d314b..336df24586a 100644 --- a/src/test/run-pass/packed-struct-size-xc.rs +++ b/src/test/run-pass/packed-struct-size-xc.rs @@ -5,6 +5,6 @@ extern mod packed; use std::mem; -fn main() { +pub fn main() { assert_eq!(mem::size_of::(), 5); } diff --git a/src/test/run-pass/priv-impl-prim-ty.rs b/src/test/run-pass/priv-impl-prim-ty.rs index 0c722e1ede5..a61b30dd480 100644 --- a/src/test/run-pass/priv-impl-prim-ty.rs +++ b/src/test/run-pass/priv-impl-prim-ty.rs @@ -13,7 +13,7 @@ extern mod bar = "priv-impl-prim-ty"; -fn main() { +pub fn main() { bar::frob(1i); } diff --git a/src/test/run-pass/privacy-reexport.rs b/src/test/run-pass/privacy-reexport.rs index eedc47ca0ad..6e0e1d6ef9e 100644 --- a/src/test/run-pass/privacy-reexport.rs +++ b/src/test/run-pass/privacy-reexport.rs @@ -13,6 +13,6 @@ extern mod privacy_reexport; -fn main() { +pub fn main() { privacy_reexport::bar::frob(); } diff --git a/src/test/run-pass/reexport-should-still-link.rs b/src/test/run-pass/reexport-should-still-link.rs index fcfcc30c988..1cd8e80ba93 100644 --- a/src/test/run-pass/reexport-should-still-link.rs +++ b/src/test/run-pass/reexport-should-still-link.rs @@ -13,6 +13,6 @@ extern mod foo = "reexport-should-still-link"; -fn main() { +pub fn main() { foo::bar(); } diff --git a/src/test/run-pass/rename-directory.rs b/src/test/run-pass/rename-directory.rs index fa4321451db..1e5dfe21cbe 100644 --- a/src/test/run-pass/rename-directory.rs +++ b/src/test/run-pass/rename-directory.rs @@ -55,4 +55,4 @@ fn rename_directory() { } } -fn main() { rename_directory() } +pub fn main() { rename_directory() } diff --git a/src/test/run-pass/signal-exit-status.rs b/src/test/run-pass/signal-exit-status.rs index c26c79112fe..dc74e9fb470 100644 --- a/src/test/run-pass/signal-exit-status.rs +++ b/src/test/run-pass/signal-exit-status.rs @@ -13,7 +13,7 @@ use std::{os, run}; use std::io::process; -fn main() { +pub fn main() { let args = os::args(); if args.len() >= 2 && args[1] == ~"signal" { // Raise a segfault. diff --git a/src/test/run-pass/smallest-hello-world.rs b/src/test/run-pass/smallest-hello-world.rs index 92513caf87d..11cef9d480a 100644 --- a/src/test/run-pass/smallest-hello-world.rs +++ b/src/test/run-pass/smallest-hello-world.rs @@ -32,7 +32,7 @@ extern "rust-intrinsic" { } #[start] -fn main(_: int, _: **u8, _: *u8) -> int { +pub fn main(_: int, _: **u8, _: *u8) -> int { unsafe { let (ptr, _): (*u8, uint) = transmute("Hello!"); puts(ptr); diff --git a/src/test/run-pass/spawning-with-debug.rs b/src/test/run-pass/spawning-with-debug.rs index f8094f9fdb9..c14ef147bc7 100644 --- a/src/test/run-pass/spawning-with-debug.rs +++ b/src/test/run-pass/spawning-with-debug.rs @@ -15,7 +15,7 @@ use std::task; -fn main() { +pub fn main() { let mut t = task::task(); t.spawn(proc() ()); } diff --git a/src/test/run-pass/static-function-pointer-xc.rs b/src/test/run-pass/static-function-pointer-xc.rs index 61790e93584..4c72c3075ff 100644 --- a/src/test/run-pass/static-function-pointer-xc.rs +++ b/src/test/run-pass/static-function-pointer-xc.rs @@ -14,7 +14,7 @@ extern mod aux = "static-function-pointer-aux"; fn f(x: int) -> int { x } -fn main() { +pub fn main() { assert_eq!(aux::F(42), -42); unsafe { assert_eq!(aux::MutF(42), -42); diff --git a/src/test/run-pass/struct_variant_xc.rs b/src/test/run-pass/struct_variant_xc.rs index 2dd7887cfcd..dc56cdf3a34 100644 --- a/src/test/run-pass/struct_variant_xc.rs +++ b/src/test/run-pass/struct_variant_xc.rs @@ -14,6 +14,6 @@ extern mod struct_variant_xc_aux; use struct_variant_xc_aux::Variant; -fn main() { +pub fn main() { let _ = Variant { arg: 1 }; } diff --git a/src/test/run-pass/syntax-extension-cfg.rs b/src/test/run-pass/syntax-extension-cfg.rs index 321929207f7..5f85ac1bd55 100644 --- a/src/test/run-pass/syntax-extension-cfg.rs +++ b/src/test/run-pass/syntax-extension-cfg.rs @@ -11,7 +11,7 @@ // xfail-fast compile-flags doesn't work with fast-check // compile-flags: --cfg foo --cfg bar(baz) --cfg qux="foo" -fn main() { +pub fn main() { // check if ! cfg!(foo) { fail!() } if cfg!(not(foo)) { fail!() } diff --git a/src/test/run-pass/tempfile.rs b/src/test/run-pass/tempfile.rs index d3bb8128a3b..eb055342acd 100644 --- a/src/test/run-pass/tempfile.rs +++ b/src/test/run-pass/tempfile.rs @@ -141,7 +141,7 @@ fn in_tmpdir(f: ||) { f(); } -fn main() { +pub fn main() { in_tmpdir(test_tempdir); in_tmpdir(test_rm_tempdir); in_tmpdir(recursive_mkdir_rel); diff --git a/src/test/run-pass/trait-bounds-in-arc.rs b/src/test/run-pass/trait-bounds-in-arc.rs index 7e13d960947..b99e6a03bcb 100644 --- a/src/test/run-pass/trait-bounds-in-arc.rs +++ b/src/test/run-pass/trait-bounds-in-arc.rs @@ -60,7 +60,7 @@ impl Pet for Goldfyshe { fn of_good_pedigree(&self) -> bool { self.swim_speed >= 500 } } -fn main() { +pub fn main() { let catte = Catte { num_whiskers: 7, name: ~"alonzo_church" }; let dogge1 = Dogge { bark_decibels: 100, tricks_known: 42, name: ~"alan_turing" }; let dogge2 = Dogge { bark_decibels: 55, tricks_known: 11, name: ~"albert_einstein" }; diff --git a/src/test/run-pass/trait-default-method-xc-2.rs b/src/test/run-pass/trait-default-method-xc-2.rs index 171971e73e0..58066adc4bd 100644 --- a/src/test/run-pass/trait-default-method-xc-2.rs +++ b/src/test/run-pass/trait-default-method-xc-2.rs @@ -9,7 +9,7 @@ use aux::A; use aux2::{a_struct, welp}; -fn main () { +pub fn main () { let a = a_struct { x: 0 }; let b = a_struct { x: 1 }; diff --git a/src/test/run-pass/trait-default-method-xc.rs b/src/test/run-pass/trait-default-method-xc.rs index 9813864724c..3323b3c952a 100644 --- a/src/test/run-pass/trait-default-method-xc.rs +++ b/src/test/run-pass/trait-default-method-xc.rs @@ -44,7 +44,7 @@ impl TestEquality for stuff::thing { } -fn main () { +pub fn main () { // Some tests of random things f(0); diff --git a/src/test/run-pass/tydesc-name.rs b/src/test/run-pass/tydesc-name.rs index 44a6a5750de..55360608bca 100644 --- a/src/test/run-pass/tydesc-name.rs +++ b/src/test/run-pass/tydesc-name.rs @@ -16,7 +16,7 @@ struct Foo { x: T } -fn main() { +pub fn main() { unsafe { assert_eq!((*get_tydesc::()).name, "int"); assert_eq!((*get_tydesc::<~[int]>()).name, "~[int]"); diff --git a/src/test/run-pass/typeid-intrinsic.rs b/src/test/run-pass/typeid-intrinsic.rs index a500e167a8b..d7feb4f4a01 100644 --- a/src/test/run-pass/typeid-intrinsic.rs +++ b/src/test/run-pass/typeid-intrinsic.rs @@ -21,7 +21,7 @@ use std::unstable::intrinsics::TypeId; struct A; struct Test; -fn main() { +pub fn main() { unsafe { assert_eq!(intrinsics::type_id::(), other1::id_A()); assert_eq!(intrinsics::type_id::(), other1::id_B()); diff --git a/src/test/run-pass/use_inline_dtor.rs b/src/test/run-pass/use_inline_dtor.rs index 73b7013742b..239416adfe0 100644 --- a/src/test/run-pass/use_inline_dtor.rs +++ b/src/test/run-pass/use_inline_dtor.rs @@ -13,6 +13,6 @@ extern mod inline_dtor; -fn main() { +pub fn main() { let _x = inline_dtor::Foo; } diff --git a/src/test/run-pass/xcrate-address-insignificant.rs b/src/test/run-pass/xcrate-address-insignificant.rs index 8a5a4a0cfe5..872c94e05fd 100644 --- a/src/test/run-pass/xcrate-address-insignificant.rs +++ b/src/test/run-pass/xcrate-address-insignificant.rs @@ -13,6 +13,6 @@ extern mod foo = "xcrate_address_insignificant"; -fn main() { +pub fn main() { assert_eq!(foo::foo::(), foo::bar()); } diff --git a/src/test/run-pass/xcrate-unit-struct.rs b/src/test/run-pass/xcrate-unit-struct.rs index 79740c7b5a5..10f3a2b037f 100644 --- a/src/test/run-pass/xcrate-unit-struct.rs +++ b/src/test/run-pass/xcrate-unit-struct.rs @@ -21,7 +21,7 @@ static s4: xcrate_unit_struct::Unit = xcrate_unit_struct::Argument(s1); fn f1(_: xcrate_unit_struct::Struct) {} fn f2(_: xcrate_unit_struct::Unit) {} -fn main() { +pub fn main() { f1(xcrate_unit_struct::Struct); f2(xcrate_unit_struct::Unit); f2(xcrate_unit_struct::Argument(xcrate_unit_struct::Struct));