test: "import" -> "use"

This commit is contained in:
Patrick Walton 2012-09-05 12:32:05 -07:00
parent 47dac47e96
commit f686896f60
270 changed files with 406 additions and 559 deletions

View file

@ -1,7 +1,7 @@
// xfail-fast aux-build
// aux-build:ambig_impl_2_lib.rs
use ambig_impl_2_lib;
import ambig_impl_2_lib::me;
use ambig_impl_2_lib::me;
trait me {
fn me() -> uint;
}

View file

@ -1,7 +1,7 @@
// xfail-test
// error-pattern: instantiating a type parameter with an incompatible type
use std;
import std::arc::rw_arc;
use std::arc::rw_arc;
fn main() {
let arc1 = ~rw_arc(true);

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::arc;
use std::arc;
fn main() {
let x = ~arc::RWARC(1);
let mut y = None;

View file

@ -1,5 +1,5 @@
use std;
import std::arc;
use std::arc;
fn main() {
let x = ~arc::RWARC(1);
let mut y = None;

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::arc;
use std::arc;
fn main() {
let x = ~arc::RWARC(1);
let mut y = None;

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::arc;
use std::arc;
fn main() {
let x = ~arc::RWARC(1);
let mut y = None;

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::arc;
use std::arc;
fn main() {
let x = ~arc::RWARC(1);
let mut y = None;

View file

@ -1,4 +1,3 @@
// error-pattern: unresolved import
import thing;
fn main() { let foo = thing::len(~[]); }

View file

@ -1,7 +1,7 @@
//buggy.rs
use std;
import std::map::hashmap;
import std::map;
use std::map::hashmap;
use std::map;
fn main() {
let buggy_map :hashmap<uint, &uint> =

View file

@ -1,6 +1,6 @@
// error-pattern: import
import m::unexported;
use m::unexported;
mod m {
export exported;

View file

@ -1,7 +1,7 @@
// error-pattern: mismatched types
use std;
import std::map::hashmap;
import std::bitv;
use std::map::hashmap;
use std::bitv;
type fn_info = {vars: hashmap<uint, var_info>};
type var_info = {a: uint, b: uint};

View file

@ -1,6 +1,6 @@
// Test that we use fully-qualified type names in error messages.
import core::task::Task;
use core::task::Task;
fn bar(x: uint) -> Task {
return x;

View file

@ -1,6 +1,6 @@
// error-pattern:unresolved
// xfail-test
import spam::{ham, eggs};
use spam::{ham, eggs};
mod spam {
fn ham() { }

View file

@ -1,2 +1,2 @@
// error-pattern:expected
import foo::{bar}::baz
use foo::{bar}::baz

View file

@ -1,6 +1,6 @@
// error-pattern:expected
import baz = foo::{bar};
use baz = foo::{bar};
mod foo {
fn bar() {}

View file

@ -1,6 +1,6 @@
// error-pattern: unresolved name
import module_of_many_things::*;
use module_of_many_things::*;
mod module_of_many_things {
export f1;

View file

@ -1,7 +1,7 @@
// error-pattern:unresolved name
import m1::*;
use m1::*;
mod m1 {
export f1;

View file

@ -1,2 +1,2 @@
// error-pattern:expected
import foo::*::bar
use foo::*::bar

View file

@ -1,6 +1,6 @@
// error-pattern:expected
import baz = foo::*;
use baz = foo::*;
mod foo {
fn bar() {}

View file

@ -1,6 +1,6 @@
// error-pattern:import
import y::x;
use y::x;
mod y {
import x;

View file

@ -1,7 +1,7 @@
// xfail-test
// error-pattern: unresolved
import zed::bar;
import zed::baz;
use zed::bar;
use zed::baz;
mod zed {
fn bar() { debug!("bar"); }
}

View file

@ -1,5 +1,5 @@
// error-pattern: unresolved
import baz::zed::bar;
use baz::zed::bar;
mod baz { }
mod zed {
fn bar() { debug!("bar3"); }

View file

@ -1,4 +1,4 @@
// error-pattern: unresolved
import main::bar;
use main::bar;
fn main(args: ~[str]) { debug!("foo"); }

View file

@ -1,7 +1,7 @@
// xfail-test
// Testing that we don't fail abnormally after hitting the errors
import unresolved::*; //~ ERROR unresolved modulename
use unresolved::*; //~ ERROR unresolved modulename
//~^ ERROR unresolved does not name a module
fn main() {

View file

@ -1,6 +1,6 @@
// xfail-test
// error-pattern:unresolved import: m::f
import x = m::f;
use x = m::f;
mod m {
}

View file

@ -1,4 +1,4 @@
import dvec::DVec;
use dvec::DVec;
type parser = {
tokens: DVec<int>,

View file

@ -1,5 +1,5 @@
// error-pattern:failed to resolve imports
import x = m::f;
use x = m::f;
mod m {
}

View file

@ -1,6 +1,5 @@
use std;
import option;
import cmp::Eq;
use cmp::Eq;
fn f<T:Eq>(&o: Option<T>) {
assert o == option::None;

View file

@ -1,7 +1,7 @@
use std;
import std::map;
import std::map::hashmap;
import std::map::map;
use std::map;
use std::map::hashmap;
use std::map::map;
// Test that trait types printed in error msgs include the type arguments.

View file

@ -1,5 +1,5 @@
// error-pattern:declaration of `None` shadows
import option::*;
use option::*;
fn main() {
let None: int = 42;

View file

@ -1,8 +1,8 @@
// error-pattern: copying a noncopyable value
use std;
import std::arc;
import comm::*;
use std::arc;
use comm::*;
fn main() {
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

View file

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

View file

@ -1,8 +1,7 @@
// -*- rust -*-
use std;
import option;
import option::Some;
use option::Some;
// error-pattern: mismatched types

View file

@ -1,7 +1,6 @@
// -*- rust -*-
use std;
import option;
import option::Some;
use option::Some;
// error-pattern: mismatched types

View file

@ -2,7 +2,7 @@
// xfail-fast
// aux-build:cci_class_5.rs
use cci_class_5;
import cci_class_5::kitties::*;
use cci_class_5::kitties::*;
fn main() {
let nyan : cat = cat(52u, 99);

View file

@ -1,7 +1,7 @@
// xfail-fast
// aux-build:cci_class.rs
use cci_class;
import cci_class::kitties::*;
use cci_class::kitties::*;
fn main() {
let nyan : cat = cat(52u, 99);

View file

@ -3,13 +3,13 @@
use std;
use syntax;
import io::*;
use io::*;
import syntax::diagnostic;
import syntax::ast;
import syntax::codemap;
import syntax::parse;
import syntax::print::*;
use syntax::diagnostic;
use syntax::ast;
use syntax::codemap;
use syntax::parse;
use syntax::print::*;
fn new_parse_sess() -> parse::parse_sess {
fail;

View file

@ -3,13 +3,13 @@
use std;
use syntax;
import std::io::*;
use std::io::*;
import syntax::diagnostic;
import syntax::ast;
import syntax::codemap;
import syntax::parse::parser;
import syntax::print::*;
use syntax::diagnostic;
use syntax::ast;
use syntax::codemap;
use syntax::parse::parser;
use syntax::print::*;
fn new_parse_sess() -> parser::parse_sess {
fail;

View file

@ -1,6 +1,5 @@
// error-pattern: mismatched types
use std;
import task;
fn main() { task::spawn(fn~() -> int { 10 }); }

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::sync;
use std::sync;
fn main() {
let m = ~sync::Mutex();

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::sync;
use std::sync;
fn main() {
let x = ~sync::RWlock();
let mut y = None;

View file

@ -1,6 +1,6 @@
// error-pattern: cannot infer an appropriate lifetime
use std;
import std::sync;
use std::sync;
fn main() {
let x = ~sync::RWlock();
let mut y = None;

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::sync;
use std::sync;
fn main() {
let x = ~sync::RWlock();
let mut y = None;

View file

@ -1,6 +1,6 @@
// error-pattern: reference is not valid outside of its lifetime
use std;
import std::sync;
use std::sync;
fn main() {
let x = ~sync::RWlock();
let mut y = None;

View file

@ -1,6 +1,6 @@
// error-pattern:unused import
// compile-flags:-W unused-imports
import cal = bar::c::cc;
use cal = bar::c::cc;
mod foo {
type point = {x: int, y: int};

View file

@ -5,7 +5,7 @@ use std;
fn f() {
}
import std::net; //~ ERROR view items must be declared at the top
use std::net; //~ ERROR view items must be declared at the top
fn main() {
}