// 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,
}
}
-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);
chan.send(val);
}
-fn main() {
+pub fn main() {
let (p,c) = Chan::new();
foo(X(31337), c);
assert!(p.recv() == X(31337));
impl <T:Pod> RequiresPod for X<T> { }
-fn main() { }
+pub fn main() { }
}
}
-fn main() {
+pub fn main() {
assert!(bar!())
}
}
}
-fn main() {
+pub fn main() {
assert!(!bar!())
}
extern mod cfg_inner_static;
-fn main() {
+pub fn main() {
cfg_inner_static::foo();
}
fn foo2() -> int { 3 }
-fn main() {
+pub fn main() {
assert_eq!(1, foo1());
assert_eq!(3, foo2());
}
// 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!() } });
}
// 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; } });
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);
extern mod cci_const;
-fn main() {
+pub fn main() {
let x = cci_const::uint_val;
match x {
cci_const::uint_val => {}
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)
}
-fn main() {}
+pub fn main() {}
D2 { x: (), y: () }
}
-fn main() {
+pub fn main() {
// check there's no segfaults
20.times(|| {
rand::random::<A>();
#[cfg(target_os = "android")]
mod hello;
-fn main() { }
\ No newline at end of file
+pub fn main() { }
use extern_calling_convention::foo;
-fn main() {
+pub fn main() {
foo(1, 2, 3, 4);
}
#[no_mangle] pub fn fun5() {}
-fn main() {
+pub fn main() {
unsafe {
let a = DynamicLibrary::open(None).unwrap();
assert!(a.symbol::<int>("fun1").is_ok());
use extern_mod_ordering_lib::extern_mod_ordering_lib;
-fn main() {
+pub fn main() {
extern_mod_ordering_lib::f();
}
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) {
}
}
-fn main() {
+pub fn main() {
let _x = baz::quux();
let _y = grault::garply();
let _z = waldo::plugh();
}
}
-fn main() {
+pub fn main() {
let _f = Foo { foo: 3 };
let _f = Foo2 { foo: 3 };
extern mod unused = "issue-11224";
-fn main() {}
+pub fn main() {}
extern mod foo = "issue-11225-1";
-fn main() {
+pub fn main() {
foo::foo(1);
}
extern mod foo = "issue-11225-2";
-fn main() {
+pub fn main() {
foo::foo(1);
}
// except according to those terms.
// xfail-test FIXME #3290
-fn main() {
+pub fn main() {
let mut x = ~3;
x = x;
assert_eq!(*x, 3);
// 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);
fn foo<T, A:Angle<T>>(theta: A) -> T { sin(&theta) }
-fn main() {}
+pub fn main() {}
}
-fn main() {
+pub fn main() {
}
}
}
-fn main() {
+pub fn main() {
let y = Y;
let _z = Z{x: y};
}
// aux-build:issue-4545.rs
extern mod somelib = "issue-4545";
-fn main() { somelib::mk::<int>(); }
+pub fn main() { somelib::mk::<int>(); }
mod local { }
-fn main() {}
+pub fn main() {}
s.combine(t)
}
-fn main() {
+pub fn main() {
let foo = Foo;
let bar = Bar;
let r = use_c(&bar, &foo);
extern mod cross_crate_self = "issue-7178";
-fn main() {
+pub fn main() {
let _ = cross_crate_self::Foo::new(&1i);
}
extern mod minimal = "issue-8044";
use minimal::{BTree, leaf};
-fn main() {
+pub fn main() {
BTree::<int> { node: leaf(1) };
}
extern mod other = "issue-8259";
static a: other::Foo<'static> = other::A;
-fn main() {}
+pub fn main() {}
// xfail-test
-fn main() {
+pub fn main() {
// This is ok
match &[(~5,~7)] {
ps => {
extern mod issue_9188;
-fn main() {
+pub fn main() {
let a = issue_9188::bar();
let b = issue_9188::foo::<int>();
assert_eq!(*a, *b);
extern mod testmod = "issue-9906";
-fn main() {
+pub fn main() {
testmod::foo();
testmod::FooBar::new(1);
}
use lib::{Trait, Struct};
-fn main()
+pub fn main()
{
Struct::init().test();
}
struct Baz;
-fn main() {
+pub fn main() {
issue_9155::Foo::new(Baz);
}
extern mod foo = "linkage-visibility";
-fn main() {
+pub fn main() {
foo::test();
foo::foo2::<int>();
foo::foo();
use std::logging;
-fn main() {
+pub fn main() {
if log_enabled!(logging::DEBUG) {
fail!("what?! debugging?");
}
use std::logging;
-fn main() {
+pub fn main() {
if log_enabled!(logging::DEBUG) {
fail!("what?! debugging?");
}
extern mod logging_right_crate;
-fn main() {
+pub fn main() {
// this function fails if logging is turned on
logging_right_crate::foo::<int>();
}
// this test will trigger "output during runtime initialization" to make sure
// that the bug isn't re-introduced.
-fn main() {}
+pub fn main() {}
#[cfg(not(foo))]
macro_rules! foo( () => (2) )
-fn main() {
+pub fn main() {
assert_eq!(foo!(), 1);
}
#[no_uv];
#[start]
-fn main(_: int, _: **u8) -> int {
+pub fn main(_: int, _: **u8) -> int {
println!("hello");
0
}
extern mod no_std_crate;
-fn main() {
+pub fn main() {
no_std_crate::foo();
}
}
#[start]
-fn main(_: int, _: **u8, _: *u8) -> int {
+pub fn main(_: int, _: **u8, _: *u8) -> int {
no_std_crate::foo();
0
}
blk();
}
-fn main() {
+pub fn main() {
let x = arc::Arc::new(true);
do foo {
assert!(*x.get());
blk();
}
-fn main() {
+pub fn main() {
let x = arc::Arc::new(true);
foo(|| {
assert!(*x.get());
}
#[cfg(target_os = "macos")]
-fn main() {
+pub fn main() {
unsafe { CFRunLoopGetTypeID(); }
}
use std::mem;
-fn main() {
+pub fn main() {
assert_eq!(mem::size_of::<packed::S>(), 5);
}
extern mod bar = "priv-impl-prim-ty";
-fn main() {
+pub fn main() {
bar::frob(1i);
}
extern mod privacy_reexport;
-fn main() {
+pub fn main() {
privacy_reexport::bar::frob();
}
extern mod foo = "reexport-should-still-link";
-fn main() {
+pub fn main() {
foo::bar();
}
}
}
-fn main() { rename_directory() }
+pub fn main() { rename_directory() }
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.
}
#[start]
-fn main(_: int, _: **u8, _: *u8) -> int {
+pub fn main(_: int, _: **u8, _: *u8) -> int {
unsafe {
let (ptr, _): (*u8, uint) = transmute("Hello!");
puts(ptr);
use std::task;
-fn main() {
+pub fn main() {
let mut t = task::task();
t.spawn(proc() ());
}
fn f(x: int) -> int { x }
-fn main() {
+pub fn main() {
assert_eq!(aux::F(42), -42);
unsafe {
assert_eq!(aux::MutF(42), -42);
use struct_variant_xc_aux::Variant;
-fn main() {
+pub fn main() {
let _ = Variant { arg: 1 };
}
// 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!() }
f();
}
-fn main() {
+pub fn main() {
in_tmpdir(test_tempdir);
in_tmpdir(test_rm_tempdir);
in_tmpdir(recursive_mkdir_rel);
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" };
use aux2::{a_struct, welp};
-fn main () {
+pub fn main () {
let a = a_struct { x: 0 };
let b = a_struct { x: 1 };
}
-fn main () {
+pub fn main () {
// Some tests of random things
f(0);
x: T
}
-fn main() {
+pub fn main() {
unsafe {
assert_eq!((*get_tydesc::<int>()).name, "int");
assert_eq!((*get_tydesc::<~[int]>()).name, "~[int]");
struct A;
struct Test;
-fn main() {
+pub fn main() {
unsafe {
assert_eq!(intrinsics::type_id::<other1::A>(), other1::id_A());
assert_eq!(intrinsics::type_id::<other1::B>(), other1::id_B());
extern mod inline_dtor;
-fn main() {
+pub fn main() {
let _x = inline_dtor::Foo;
}
extern mod foo = "xcrate_address_insignificant";
-fn main() {
+pub fn main() {
assert_eq!(foo::foo::<f64>(), foo::bar());
}
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));