1
Fork 0

test: De-export aux, bench, compile-fail, and run-fail. rs=deexporting

This commit is contained in:
Patrick Walton 2013-01-30 14:30:22 -08:00
commit 2a65842c3a
85 changed files with 223 additions and 414 deletions

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports]; pub fn foo(x: &uint) -> uint {
fn foo(x: &uint) -> uint {
*x *x
} }

View file

@ -8,22 +8,17 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports]; pub mod kitties {
mod kitties { pub struct cat {
#[legacy_exports]; priv mut meows : uint,
struct cat { how_hungry : int,
priv mut meows : uint, }
how_hungry : int, pub fn cat(in_x : uint, in_y : int) -> cat {
}
fn cat(in_x : uint, in_y : int) -> cat {
cat { cat {
meows: in_x, meows: in_x,
how_hungry: in_y how_hungry: in_y
} }
} }
} }

View file

@ -8,26 +8,23 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports]; pub mod kitties {
pub struct cat {
priv mut meows : uint,
mod kitties { how_hungry : int,
#[legacy_exports];
struct cat { }
priv mut meows : uint,
how_hungry : int, pub impl cat {
}
impl cat {
fn speak() {} fn speak() {}
} }
fn cat(in_x : uint, in_y : int) -> cat {
pub fn cat(in_x : uint, in_y : int) -> cat {
cat { cat {
meows: in_x, meows: in_x,
how_hungry: in_y how_hungry: in_y
} }
} }
} }

View file

@ -8,28 +8,22 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports]; pub mod kitties {
pub struct cat {
priv mut meows : uint,
mod kitties { how_hungry : int,
#[legacy_exports]; }
struct cat { pub impl cat {
priv mut meows : uint,
how_hungry : int,
}
impl cat {
fn speak() { self.meows += 1u; } fn speak() { self.meows += 1u; }
fn meow_count() -> uint { self.meows } fn meow_count() -> uint { self.meows }
} }
fn cat(in_x : uint, in_y : int) -> cat { pub fn cat(in_x : uint, in_y : int) -> cat {
cat { cat {
meows: in_x, meows: in_x,
how_hungry: in_y how_hungry: in_y
} }
} }
} }

View file

@ -8,35 +8,31 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports]; pub mod kitties {
mod kitties { pub struct cat {
#[legacy_exports]; priv mut meows : uint,
struct cat { mut how_hungry : int,
priv mut meows : uint, name : ~str,
mut how_hungry : int,
name : ~str,
}
impl cat {
fn speak() { self.meow(); }
fn eat() -> bool {
if self.how_hungry > 0 {
error!("OM NOM NOM");
self.how_hungry -= 2;
return true;
} }
else {
error!("Not hungry!");
return false;
}
}
}
priv impl cat { pub impl cat {
fn speak() { self.meow(); }
fn eat() -> bool {
if self.how_hungry > 0 {
error!("OM NOM NOM");
self.how_hungry -= 2;
return true;
}
else {
error!("Not hungry!");
return false;
}
}
}
pub impl cat {
fn meow() { fn meow() {
error!("Meow"); error!("Meow");
self.meows += 1u; self.meows += 1u;
@ -46,12 +42,11 @@ impl cat {
} }
} }
fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { pub fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
cat { cat {
meows: in_x, meows: in_x,
how_hungry: in_y, how_hungry: in_y,
name: in_name name: in_name
} }
} }
} }

View file

@ -8,14 +8,13 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
mod kitties { pub mod kitties {
pub struct cat { pub struct cat {
priv mut meows : uint, priv mut meows : uint,
how_hungry : int, how_hungry : int,
} }
impl cat { pub impl cat {
priv fn nap() { for uint::range(1, 10000u) |_i|{}} priv fn nap() { for uint::range(1, 10000u) |_i|{}}
} }
@ -26,4 +25,4 @@ mod kitties {
} }
} }
} }

View file

@ -8,32 +8,27 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports]; pub mod kitties {
pub struct cat<U> {
priv mut info : ~[U],
priv mut meows : uint,
mod kitties { how_hungry : int,
#[legacy_exports]; }
struct cat<U> { pub impl<U> cat<U> {
priv mut info : ~[U],
priv mut meows : uint,
how_hungry : int,
}
impl<U> cat<U> {
fn speak<T>(stuff: ~[T]) { fn speak<T>(stuff: ~[T]) {
self.meows += stuff.len(); self.meows += stuff.len();
} }
fn meow_count() -> uint { self.meows } fn meow_count() -> uint { self.meows }
} }
fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> { pub fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> {
cat { cat {
meows: in_x, meows: in_x,
how_hungry: in_y, how_hungry: in_y,
info: move in_info info: move in_info
}
} }
} }
}

View file

@ -8,11 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
mod animals { pub mod animals {
#[legacy_exports]; pub trait noisy {
fn speak();
trait noisy { }
fn speak();
}
} }

View file

@ -8,10 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports];
#[abi = "rust-intrinsic"] #[abi = "rust-intrinsic"]
extern mod rusti { pub extern mod rusti {
#[legacy_exports];
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int; fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int; fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int; fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
@ -30,7 +28,7 @@ extern mod rusti {
} }
#[inline(always)] #[inline(always)]
fn atomic_xchg(dst: &mut int, src: int) -> int { pub fn atomic_xchg(dst: &mut int, src: int) -> int {
unsafe { unsafe {
rusti::atomic_xchg(dst, src) rusti::atomic_xchg(dst, src)
} }

View file

@ -10,10 +10,9 @@
#[link(name="cci_iter_lib", vers="0.0")]; #[link(name="cci_iter_lib", vers="0.0")];
#[legacy_modes]; #[legacy_modes];
#[legacy_exports];
#[inline] #[inline]
fn iter<T>(v: ~[T], f: fn(T)) { pub fn iter<T>(v: ~[T], f: fn(T)) {
let mut i = 0u; let mut i = 0u;
let n = vec::len(v); let n = vec::len(v);
while i < n { while i < n {

View file

@ -9,19 +9,18 @@
// except according to those terms. // except according to those terms.
#[legacy_modes]; #[legacy_modes];
#[legacy_exports];
use dvec::DVec; use dvec::DVec;
struct Entry<A,B> {key: A, value: B} pub struct Entry<A,B> {key: A, value: B}
struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> } pub struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> }
fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) { pub fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) {
lst.data.push(Entry{key:k, value:v}); lst.data.push(Entry{key:k, value:v});
} }
fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B { pub fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
let eq_fn = lst.eq_fn; let eq_fn = lst.eq_fn;
for lst.data.each |entry| { for lst.data.each |entry| {
if eq_fn(entry.key, k) { return entry.value; } if eq_fn(entry.key, k) { return entry.value; }
@ -30,13 +29,13 @@ fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
} }
#[inline] #[inline]
fn new_int_alist<B: Copy>() -> alist<int, B> { pub fn new_int_alist<B: Copy>() -> alist<int, B> {
fn eq_int(&&a: int, &&b: int) -> bool { a == b } fn eq_int(&&a: int, &&b: int) -> bool { a == b }
return alist {eq_fn: eq_int, data: DVec()}; return alist {eq_fn: eq_int, data: DVec()};
} }
#[inline] #[inline]
fn new_int_alist_2<B: Copy>() -> alist<int, B> { pub fn new_int_alist_2<B: Copy>() -> alist<int, B> {
#[inline] #[inline]
fn eq_int(&&a: int, &&b: int) -> bool { a == b } fn eq_int(&&a: int, &&b: int) -> bool { a == b }
return alist {eq_fn: eq_int, data: DVec()}; return alist {eq_fn: eq_int, data: DVec()};

View file

@ -9,10 +9,9 @@
// except according to those terms. // except according to those terms.
#[link(name="cci_no_inline_lib", vers="0.0")]; #[link(name="cci_no_inline_lib", vers="0.0")];
#[legacy_exports];
// same as cci_iter_lib, more-or-less, but not marked inline // same as cci_iter_lib, more-or-less, but not marked inline
fn iter(v: ~[uint], f: fn(uint)) { pub fn iter(v: ~[uint], f: fn(uint)) {
let mut i = 0u; let mut i = 0u;
let n = vec::len(v); let n = vec::len(v);
while i < n { while i < n {
@ -20,3 +19,4 @@ fn iter(v: ~[uint], f: fn(uint)) {
i += 1u; i += 1u;
} }
} }

View file

@ -10,40 +10,31 @@
#[link(name = "crate_method_reexport_grrrrrrr2")]; #[link(name = "crate_method_reexport_grrrrrrr2")];
export rust;
use name_pool::add; use name_pool::add;
mod name_pool { mod name_pool {
#[legacy_exports]; pub type name_pool = ();
type name_pool = (); pub trait add {
trait add {
fn add(s: ~str); fn add(s: ~str);
} }
impl name_pool: add { pub impl name_pool: add {
fn add(s: ~str) { fn add(s: ~str) {
} }
} }
} }
mod rust { pub mod rust {
#[legacy_exports];
use name_pool::add; use name_pool::add;
export add;
export rt;
export cx;
type rt = @(); pub type rt = @();
trait cx { pub trait cx {
fn cx(); fn cx();
} }
impl rt: cx { pub impl rt: cx {
fn cx() { fn cx() {
} }
} }

View file

@ -12,6 +12,5 @@
vers = "0.1")]; vers = "0.1")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 10 } pub fn f() -> int { 10 }

View file

@ -12,6 +12,5 @@
vers = "0.2")]; vers = "0.2")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 20 } pub fn f() -> int { 20 }

View file

@ -12,6 +12,5 @@
vers = "0.3")]; vers = "0.3")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 30 } pub fn f() -> int { 30 }

View file

@ -12,6 +12,5 @@
vers = "0.1")]; vers = "0.1")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 10 } pub fn f() -> int { 10 }

View file

@ -12,6 +12,5 @@
vers = "0.2")]; vers = "0.2")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 20 } pub fn f() -> int { 20 }

View file

@ -12,6 +12,5 @@
vers = "0.3")]; vers = "0.3")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 30 } pub fn f() -> int { 30 }

View file

@ -12,6 +12,5 @@
vers = "0.1")]; vers = "0.1")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 10 } pub fn f() -> int { 10 }

View file

@ -12,6 +12,5 @@
vers = "0.2")]; vers = "0.2")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn g() -> int { 20 } pub fn g() -> int { 20 }

View file

@ -10,6 +10,5 @@
#[link(name = "crateresolve4a", vers = "0.1")]; #[link(name = "crateresolve4a", vers = "0.1")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 10 } pub fn f() -> int { 10 }

View file

@ -10,6 +10,5 @@
#[link(name = "crateresolve4a", vers= "0.2")]; #[link(name = "crateresolve4a", vers= "0.2")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn g() -> int { 20 } pub fn g() -> int { 20 }

View file

@ -12,8 +12,7 @@
// aux-build:crateresolve4a-2.rs // aux-build:crateresolve4a-2.rs
#[link(name = "crateresolve4b", vers = "0.1")]; #[link(name = "crateresolve4b", vers = "0.1")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
extern mod crateresolve4a(vers="0.2"); extern mod crateresolve4a(vers="0.2");
fn f() -> int { crateresolve4a::g() } pub fn f() -> int { crateresolve4a::g() }

View file

@ -12,8 +12,7 @@
// aux-build:crateresolve4a-2.rs // aux-build:crateresolve4a-2.rs
#[link(name = "crateresolve4b", vers = "0.2")]; #[link(name = "crateresolve4b", vers = "0.2")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
extern mod crateresolve4a(vers="0.1"); extern mod crateresolve4a(vers="0.1");
fn g() -> int { crateresolve4a::f() } pub fn g() -> int { crateresolve4a::f() }

View file

@ -12,18 +12,17 @@
vers = "0.1")]; vers = "0.1")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
struct NameVal { name: ~str, val: int } pub struct NameVal { name: ~str, val: int }
fn struct_nameval() -> NameVal { pub fn struct_nameval() -> NameVal {
NameVal { name: ~"crateresolve5", val: 10 } NameVal { name: ~"crateresolve5", val: 10 }
} }
enum e { pub enum e {
e_val e_val
} }
fn nominal() -> e { e_val } pub fn nominal() -> e { e_val }
fn f() -> int { 10 } pub fn f() -> int { 10 }

View file

@ -12,17 +12,16 @@
vers = "0.2")]; vers = "0.2")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
struct NameVal { name: ~str, val: int } pub struct NameVal { name: ~str, val: int }
fn struct_nameval() -> NameVal { pub fn struct_nameval() -> NameVal {
NameVal { name: ~"crateresolve5", val: 10 } NameVal { name: ~"crateresolve5", val: 10 }
} }
enum e { pub enum e {
e_val e_val
} }
fn nominal() -> e { e_val } pub fn nominal() -> e { e_val }
fn f() -> int { 20 } pub fn f() -> int { 20 }

View file

@ -13,15 +13,12 @@
// aux-build:crateresolve_calories-2.rs // aux-build:crateresolve_calories-2.rs
// These both have the same version but differ in other metadata // These both have the same version but differ in other metadata
#[legacy_exports]; pub mod a {
mod a {
#[legacy_exports];
extern mod cr_1 (name = "crateresolve_calories", vers = "0.1", calories="100"); extern mod cr_1 (name = "crateresolve_calories", vers = "0.1", calories="100");
fn f() -> int { cr_1::f() } pub fn f() -> int { cr_1::f() }
} }
mod b { pub mod b {
#[legacy_exports];
extern mod cr_2 (name = "crateresolve_calories", vers = "0.1", calories="200"); extern mod cr_2 (name = "crateresolve_calories", vers = "0.1", calories="200");
fn f() -> int { cr_2::f() } pub fn f() -> int { cr_2::f() }
} }

View file

@ -13,6 +13,5 @@
calories = "100")]; calories = "100")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 100 } pub fn f() -> int { 100 }

View file

@ -13,6 +13,5 @@
calories = "200")]; calories = "200")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
fn f() -> int { 200 } pub fn f() -> int { 200 }

View file

@ -12,22 +12,20 @@
vers = "0.1")]; vers = "0.1")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
extern mod rustrt { pub extern mod rustrt {
#[legacy_exports]; pub fn rust_dbg_call(cb: *u8,
fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t;
data: libc::uintptr_t) -> libc::uintptr_t;
} }
fn fact(n: uint) -> uint { pub fn fact(n: uint) -> uint {
unsafe { unsafe {
debug!("n = %?", n); debug!("n = %?", n);
rustrt::rust_dbg_call(cb, n) rustrt::rust_dbg_call(cb, n)
} }
} }
extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { pub extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t {
if data == 1u { if data == 1u {
data data
} else { } else {

View file

@ -9,9 +9,7 @@
// except according to those terms. // except according to those terms.
#[link(name="foreign_lib", vers="0.0")]; #[link(name="foreign_lib", vers="0.0")];
#[legacy_exports];
extern mod rustrt { pub extern mod rustrt {
#[legacy_exports]; pub fn last_os_error() -> ~str;
fn last_os_error() -> ~str; }
}

View file

@ -10,11 +10,10 @@
#[link(name = "a", vers = "0.0")]; #[link(name = "a", vers = "0.0")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
trait i<T> { } pub trait i<T> { }
fn f<T>() -> i<T> { pub fn f<T>() -> i<T> {
impl<T> (): i<T> { } impl<T> (): i<T> { }
() as i::<T> () as i::<T>

View file

@ -10,27 +10,21 @@
#[link(name="socketlib", vers="0.0")]; #[link(name="socketlib", vers="0.0")];
#[crate_type = "lib"]; #[crate_type = "lib"];
#[legacy_exports];
mod socket { pub mod socket {
#[legacy_exports]; pub struct socket_handle {
sockfd: libc::c_int,
export socket_handle;
struct socket_handle {
sockfd: libc::c_int,
}
impl socket_handle : Drop {
fn finalize(&self) {
/* c::close(self.sockfd); */
} }
}
fn socket_handle(x: libc::c_int) -> socket_handle { pub impl socket_handle : Drop {
fn finalize(&self) {
/* c::close(self.sockfd); */
}
}
pub fn socket_handle(x: libc::c_int) -> socket_handle {
socket_handle { socket_handle {
sockfd: x sockfd: x
} }
} }
} }

View file

@ -10,18 +10,12 @@
extern mod issue_2316_a; extern mod issue_2316_a;
mod cloth { pub mod cloth {
#[legacy_exports]; use issue_2316_a::*;
use issue_2316_a::*;
export calico, gingham, flannel;
export fabric;
enum fabric {
gingham, flannel, calico
}
pub enum fabric {
gingham, flannel, calico
}
} }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports]; pub unsafe fn f(xs: ~[int]) {
unsafe fn f(xs: ~[int]) { xs.map(|_x| { unsafe fn q() { fail; } });
xs.map(|_x| { unsafe fn q() { fail; } }); }
}

View file

@ -22,8 +22,7 @@ use core::os;
// an llvm intrinsic. // an llvm intrinsic.
#[nolink] #[nolink]
extern mod libc { extern mod libc {
#[legacy_exports]; pub fn sqrt(n: float) -> float;
fn sqrt(n: float) -> float;
} }
fn main() { fn main() {

View file

@ -12,5 +12,4 @@
// asterisk is bogus // asterisk is bogus
#[attr*] #[attr*]
mod m { mod m {}
#[legacy_exports]; }

View file

@ -10,7 +10,6 @@
// error-pattern: unresolved name: m1::a // error-pattern: unresolved name: m1::a
mod m1 { mod m1 {}
#[legacy_exports]; }
fn main(args: ~[str]) { log(debug, m1::a); } fn main(args: ~[str]) { log(debug, m1::a); }

View file

@ -11,9 +11,7 @@
// error-pattern: unresolved name: m1::a // error-pattern: unresolved name: m1::a
mod m1 { mod m1 {
#[legacy_exports]; pub mod a {}
mod a {
#[legacy_exports]; }
} }
fn main(args: ~[str]) { log(debug, m1::a); } fn main(args: ~[str]) { log(debug, m1::a); }

View file

@ -16,8 +16,7 @@
extern mod crateresolve2(vers = "0.1"); extern mod crateresolve2(vers = "0.1");
mod m { mod m {
#[legacy_exports]; pub extern mod crateresolve2(vers = "0.2");
extern mod crateresolve2(vers = "0.2");
} }
fn main() { fn main() {

View file

@ -12,5 +12,4 @@
#[link_name = ""] #[link_name = ""]
extern mod foo { extern mod foo {
#[legacy_exports];
} }

View file

@ -14,5 +14,4 @@
#[link_name = ""] #[link_name = ""]
#[nolink] #[nolink]
extern mod foo { extern mod foo {
#[legacy_exports];
} }

View file

@ -15,11 +15,7 @@
// want to change eventually. // want to change eventually.
mod foo { mod foo {
#[legacy_exports]; pub fn bar() { foo::baz(); }
export bar;
fn bar() { foo::baz(); }
fn baz() { } fn baz() { }
} }

View file

@ -13,10 +13,7 @@
use m::unexported; use m::unexported;
mod m { mod m {
#[legacy_exports]; pub fn exported() { }
export exported;
fn exported() { }
fn unexported() { } fn unexported() { }
} }

View file

@ -11,10 +11,7 @@
// error-pattern: unresolved name // error-pattern: unresolved name
mod foo { mod foo {
#[legacy_exports]; pub fn x() { }
export x;
fn x() { }
enum y { y1, } enum y { y1, }
} }

View file

@ -10,9 +10,7 @@
// error-pattern: unresolved name // error-pattern: unresolved name
mod foo { mod foo {
#[legacy_exports]; pub fn x(y: int) { log(debug, y); }
export x;
fn x(y: int) { log(debug, y); }
fn z(y: int) { log(debug, y); } fn z(y: int) { log(debug, y); }
} }

View file

@ -11,19 +11,13 @@
// error-pattern: unresolved name // error-pattern: unresolved name
mod foo { mod foo {
#[legacy_exports]; pub fn x() { bar::x(); }
export x;
fn x() { bar::x(); }
} }
mod bar { mod bar {
#[legacy_exports];
export y;
fn x() { debug!("x"); } fn x() { debug!("x"); }
fn y() { } pub fn y() { }
} }
fn main() { foo::x(); } fn main() { foo::x(); }

View file

@ -12,8 +12,7 @@
#[abi = "cdecl"] #[abi = "cdecl"]
extern mod test { extern mod test {
#[legacy_exports]; pub unsafe fn free();
unsafe fn free();
} }
fn main() { fn main() {

View file

@ -12,8 +12,7 @@
#[abi = "cdecl"] #[abi = "cdecl"]
extern mod test { extern mod test {
#[legacy_exports]; pub unsafe fn free();
unsafe fn free();
} }
fn main() { fn main() {

View file

@ -11,13 +11,11 @@
// Test that we use fully-qualified type names in error messages. // Test that we use fully-qualified type names in error messages.
mod x { mod x {
#[legacy_exports]; pub enum foo { }
enum foo { }
} }
mod y { mod y {
#[legacy_exports]; pub enum foo { }
enum foo { }
} }
fn bar(x: x::foo) -> y::foo { fn bar(x: x::foo) -> y::foo {

View file

@ -12,8 +12,7 @@
use spam::{ham, eggs}; use spam::{ham, eggs};
mod spam { mod spam {
#[legacy_exports]; pub fn ham() { }
fn ham() { }
} }
fn main() { ham(); eggs(); } fn main() { ham(); eggs(); }

View file

@ -13,9 +13,8 @@
use baz = foo::{bar}; use baz = foo::{bar};
mod foo { mod foo {
#[legacy_exports]; pub fn bar() {}
fn bar() {}
} }
fn main() { fn main() {
} }

View file

@ -13,15 +13,10 @@
use module_of_many_things::*; use module_of_many_things::*;
mod module_of_many_things { mod module_of_many_things {
#[legacy_exports]; pub fn f1() { debug!("f1"); }
export f1; pub fn f2() { debug!("f2"); }
export f2;
export f4;
fn f1() { debug!("f1"); }
fn f2() { debug!("f2"); }
fn f3() { debug!("f3"); } fn f3() { debug!("f3"); }
fn f4() { debug!("f4"); } pub fn f4() { debug!("f4"); }
} }

View file

@ -11,27 +11,18 @@
// error-pattern: unresolved // error-pattern: unresolved
mod circ1 { mod circ1 {
#[legacy_exports]; pub use circ2::f2;
use circ1::*; pub fn f1() { debug!("f1"); }
export f1; pub fn common() -> uint { return 0u; }
export f2;
export common;
fn f1() { debug!("f1"); }
fn common() -> uint { return 0u; }
} }
mod circ2 { mod circ2 {
#[legacy_exports]; pub use circ1::f1;
use circ2::*; pub fn f2() { debug!("f2"); }
export f1; pub fn common() -> uint { return 1u; }
export f2;
export common;
fn f2() { debug!("f2"); }
fn common() -> uint { return 1u; }
} }
mod test { mod test {
#[legacy_exports];
use circ1::*; use circ1::*;
fn test() { f1066(); } fn test() { f1066(); }

View file

@ -1,23 +0,0 @@
// Copyright 2012 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.
// error-pattern:unresolved name
use m1::*;
mod m1 {
#[legacy_exports];
export f1;
fn f1() { }
fn f2() { }
}
fn main() { f2(); }

View file

@ -13,9 +13,8 @@
use baz = foo::*; use baz = foo::*;
mod foo { mod foo {
#[legacy_exports]; pub fn bar() {}
fn bar() {}
} }
fn main() { fn main() {
} }

View file

@ -11,15 +11,11 @@
// error-pattern:import // error-pattern:import
mod a { mod a {
#[legacy_exports]; pub use b::x;
import b::x;
export x;
} }
mod b { mod b {
#[legacy_exports]; pub use a::x;
import a::x;
export x;
fn main() { let y = x; } fn main() { let y = x; }
} }

View file

@ -13,9 +13,7 @@
use y::x; use y::x;
mod y { mod y {
#[legacy_exports]; pub use y::x;
import x;
export x;
} }
fn main() { } fn main() { }

View file

@ -12,7 +12,6 @@
use zed::bar; use zed::bar;
use zed::baz; use zed::baz;
mod zed { mod zed {
#[legacy_exports]; pub fn bar() { debug!("bar"); }
fn bar() { debug!("bar"); }
} }
fn main(args: ~[str]) { bar(); } fn main(args: ~[str]) { bar(); }

View file

@ -10,10 +10,8 @@
// error-pattern: unresolved // error-pattern: unresolved
use baz::zed::bar; use baz::zed::bar;
mod baz { mod baz {}
#[legacy_exports]; }
mod zed { mod zed {
#[legacy_exports]; pub fn bar() { debug!("bar3"); }
fn bar() { debug!("bar3"); }
} }
fn main(args: ~[str]) { bar(); } fn main(args: ~[str]) { bar(); }

View file

@ -10,9 +10,7 @@
// error-pattern: import // error-pattern: import
mod a { mod a { pub use b::foo; }
#[legacy_exports]; import foo = b::foo; export foo; } mod b { pub use a::foo; }
mod b {
#[legacy_exports]; import foo = a::foo; export foo; }
fn main(args: ~[str]) { debug!("loop"); } fn main(args: ~[str]) { debug!("loop"); }

View file

@ -10,7 +10,6 @@
// error-pattern:expected item // error-pattern:expected item
mod blade_runner { mod blade_runner {
#[legacy_exports];
#~[doc( #~[doc(
brief = "Blade Runner is probably the best movie ever", brief = "Blade Runner is probably the best movie ever",
desc = "I like that in the world of Blade Runner it is always desc = "I like that in the world of Blade Runner it is always

View file

@ -11,7 +11,6 @@
use x = m::f; //~ ERROR failed to resolve import use x = m::f; //~ ERROR failed to resolve import
mod m { mod m {
#[legacy_exports];
} }
fn main() { fn main() {

View file

@ -9,8 +9,7 @@
// except according to those terms. // except according to those terms.
mod bar { mod bar {
#[legacy_exports]; pub enum foo {
enum foo {
alpha, alpha,
beta, beta,
charlie charlie

View file

@ -12,7 +12,6 @@
use x = m::f; use x = m::f;
mod m { mod m {
#[legacy_exports];
} }
fn main() { fn main() {

View file

@ -8,10 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports] pub mod a {}
mod a {}
#[legacy_exports] pub mod a {} //~ ERROR duplicate definition of type a
mod a {} //~ ERROR duplicate definition of type a
fn main() {} fn main() {}

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[legacy_exports] pub mod break {
mod break {
//~^ ERROR found `break` in ident position //~^ ERROR found `break` in ident position
} }

View file

@ -16,7 +16,6 @@ the compiler output. */
#[link_args = "aFdEfSeVEEE"] #[link_args = "aFdEfSeVEEE"]
#[nolink] #[nolink]
extern mod m1 { extern mod m1 {}
#[legacy_exports]; }
fn main() { } fn main() { }

View file

@ -9,12 +9,11 @@
// except according to those terms. // except according to those terms.
mod a { mod a {
#[legacy_exports]; pub struct Foo {
struct Foo {
x: int x: int
} }
impl Foo { pub impl Foo {
priv fn foo() {} priv fn foo() {}
} }
} }

View file

@ -9,7 +9,6 @@
// except according to those terms. // except according to those terms.
mod a { mod a {
#[legacy_exports];
priv fn f() {} priv fn f() {}
} }

View file

@ -11,24 +11,22 @@
// error-pattern:method `nap` is private // error-pattern:method `nap` is private
mod kitties { mod kitties {
#[legacy_exports]; pub struct cat {
struct cat { priv mut meows : uint,
priv mut meows : uint,
how_hungry : int, how_hungry : int,
}
}
pub impl cat {
impl cat { priv fn nap() { uint::range(1u, 10000u, |_i| false)}
priv fn nap() { uint::range(1u, 10000u, |_i| false)} }
}
pub fn cat(in_x : uint, in_y : int) -> cat {
fn cat(in_x : uint, in_y : int) -> cat { cat {
cat { meows: in_x,
meows: in_x, how_hungry: in_y
how_hungry: in_y }
} }
}
} }
fn main() { fn main() {

View file

@ -9,8 +9,7 @@
// except according to those terms. // except according to those terms.
mod a { mod a {
#[legacy_exports]; pub struct Foo {
struct Foo {
priv x: int priv x: int
} }
} }

View file

@ -11,12 +11,11 @@
use a::Foo; use a::Foo;
mod a { mod a {
#[legacy_exports]; pub struct Foo {
struct Foo {
priv x: int priv x: int
} }
fn make() -> Foo { pub fn make() -> Foo {
Foo { x: 3 } Foo { x: 3 }
} }
} }

View file

@ -9,12 +9,11 @@
// except according to those terms. // except according to those terms.
mod cat { mod cat {
#[legacy_exports]; pub struct Cat {
struct Cat {
priv meows: uint priv meows: uint
} }
fn new_cat() -> Cat { pub fn new_cat() -> Cat {
Cat { meows: 52 } Cat { meows: 52 }
} }
} }

View file

@ -9,8 +9,7 @@
// except according to those terms. // except according to those terms.
mod a { mod a {
#[legacy_exports]; pub enum Waffle {
enum Waffle {
Belgian, Belgian,
Brussels, Brussels,
priv Liege priv Liege

View file

@ -19,11 +19,9 @@
#[link_name= "m"] #[link_name= "m"]
#[link_args="-foo"] // this could have been elided. #[link_args="-foo"] // this could have been elided.
extern mod m1 { extern mod m1 {
#[legacy_exports];
} }
#[link_name= "m"] #[link_name= "m"]
#[link_args="-bar"] // this is the actual error trigger. #[link_args="-bar"] // this is the actual error trigger.
extern mod m2 { extern mod m2 {
#[legacy_exports];
} }

View file

@ -9,23 +9,22 @@
// except according to those terms. // except according to those terms.
mod argparse { mod argparse {
#[legacy_exports];
extern mod std; extern mod std;
use either::{Either, Left, Right}; use either::{Either, Left, Right};
struct Flag { pub struct Flag {
name: &str, name: &str,
desc: &str, desc: &str,
max_count: uint, max_count: uint,
mut value: uint mut value: uint
} }
fn flag(name: &r/str, desc: &r/str) -> Flag/&r { pub fn flag(name: &r/str, desc: &r/str) -> Flag/&r {
Flag { name: name, desc: desc, max_count: 1, value: 0 } Flag { name: name, desc: desc, max_count: 1, value: 0 }
} }
impl Flag { pub impl Flag {
fn set_desc(self, s: &str) -> Flag { fn set_desc(self, s: &str) -> Flag {
Flag { //~ ERROR cannot infer an appropriate lifetime Flag { //~ ERROR cannot infer an appropriate lifetime
name: self.name, name: self.name,

View file

@ -13,18 +13,15 @@
use cal = bar::c::cc; use cal = bar::c::cc;
mod foo { mod foo {
#[legacy_exports]; pub type point = {x: int, y: int};
type point = {x: int, y: int}; pub type square = {p: point, h: uint, w: uint};
type square = {p: point, h: uint, w: uint};
} }
mod bar { mod bar {
#[legacy_exports]; pub mod c {
mod c {
#[legacy_exports];
use foo::point; use foo::point;
use foo::square; use foo::square;
fn cc(p: point) -> str { return 2 * (p.x + p.y); } pub fn cc(p: point) -> str { return 2 * (p.x + p.y); }
} }
} }

View file

@ -13,9 +13,8 @@
#[nolink] #[nolink]
extern mod libc { extern mod libc {
#[legacy_exports]; pub fn malloc(size: int) -> *u8;
fn malloc(size: int) -> *u8;
} }
fn main() { fn main() {
} }

View file

@ -12,9 +12,8 @@
// error-pattern:found rust type // error-pattern:found rust type
#[nolink] #[nolink]
extern mod libc { extern mod libc {
#[legacy_exports]; pub fn malloc(size: int) -> *u8;
fn malloc(size: int) -> *u8;
} }
fn main() { fn main() {
} }

View file

@ -10,9 +10,8 @@
//error-pattern:libc::c_int or libc::c_long should be used //error-pattern:libc::c_int or libc::c_long should be used
extern mod xx { extern mod xx {
#[legacy_exports]; pub fn strlen(str: *u8) -> uint;
fn strlen(str: *u8) -> uint; pub fn foo(x: int, y: uint);
fn foo(x: int, y: uint);
} }
fn main() { fn main() {

View file

@ -13,9 +13,8 @@
// Instead the failure will be delivered after the callbacks return. // Instead the failure will be delivered after the callbacks return.
extern mod rustrt { extern mod rustrt {
#[legacy_exports]; pub fn rust_dbg_call(cb: *u8,
fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t;
data: libc::uintptr_t) -> libc::uintptr_t;
} }
extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t {

View file

@ -18,8 +18,7 @@
extern mod std; extern mod std;
extern mod rustrt { extern mod rustrt {
#[legacy_exports]; pub fn last_os_error() -> ~str;
fn last_os_error() -> ~str;
} }
fn getbig_call_c_and_fail(i: int) { fn getbig_call_c_and_fail(i: int) {

View file

@ -14,10 +14,7 @@
extern mod std; extern mod std;
mod m { mod m {
#[legacy_exports]; pub fn exported() { }
export exported;
fn exported() { }
#[test] #[test]
fn unexported() { fail ~"runned an unexported test"; } fn unexported() { fail ~"runned an unexported test"; }