test: Fix a bunch of compile-fail tests. rs=bustage

This commit is contained in:
Patrick Walton 2012-12-28 19:36:35 -08:00
parent b92ea8dc78
commit 5bd8692e9d
7 changed files with 17 additions and 18 deletions

View File

@ -8,7 +8,5 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[legacy_exports];
export foo;
type oint = Option<int>;
fn foo() -> oint { Some(3) }
pub fn foo() -> oint { Some(3) }

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use either::*;
use core::either::*;
enum X = Either<(uint,uint),fn()>;
impl &X {
fn with(blk: fn(x: &Either<(uint,uint),fn()>)) {
@ -26,4 +26,4 @@ fn main() {
_ => fail
}
}
}
}

View File

@ -10,8 +10,7 @@
// Testing that we don't fail abnormally after hitting the errors
use unresolved::*; //~ ERROR unresolved name
//~^ ERROR failed to resolve import
use unresolved::*; //~ ERROR unresolved import
fn main() {
}

View File

@ -8,16 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
mod stream {
#[legacy_exports];
enum Stream<T: Owned> { send(T, server::Stream<T>), }
mod server {
#[legacy_exports];
pub mod stream {
pub enum Stream<T: Owned> { send(T, ::stream::server::Stream<T>), }
pub mod server {
use core::option;
use core::pipes;
impl<T: Owned> Stream<T> {
fn recv() -> extern fn(+v: Stream<T>) -> stream::Stream<T> {
pub fn recv() -> extern fn(+v: Stream<T>) -> ::stream::Stream<T> {
// resolve really should report just one error here.
// Change the test case when it changes.
fn recv(+pipe: Stream<T>) -> stream::Stream<T> { //~ ERROR attempt to use a type argument out of scope
pub fn recv(+pipe: Stream<T>) -> ::stream::Stream<T> { //~ ERROR attempt to use a type argument out of scope
//~^ ERROR use of undeclared type name
//~^^ ERROR attempt to use a type argument out of scope
//~^^^ ERROR use of undeclared type name
@ -26,7 +27,8 @@ fn recv(+pipe: Stream<T>) -> stream::Stream<T> { //~ ERROR attempt to use a type
recv
}
}
type Stream<T: Owned> = pipes::RecvPacket<stream::Stream<T>>;
pub type Stream<T: Owned> = pipes::RecvPacket<::stream::Stream<T>>;
}
}

View File

@ -9,7 +9,7 @@
// except according to those terms.
// error-pattern:declaration of `None` shadows
use option::*;
use core::option::*;
fn main() {
let None: int = 42;

View File

@ -12,7 +12,7 @@
extern mod std;
use std::arc;
use oldcomm::*;
use core::oldcomm::*;
fn main() {
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

View File

@ -10,7 +10,7 @@
extern mod std;
use std::arc;
use oldcomm::*;
use core::oldcomm::*;
fn main() {
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];