libcore: "import" -> "use"

This commit is contained in:
Patrick Walton 2012-09-04 11:12:17 -07:00
parent 147e9380e2
commit 437073868e
37 changed files with 154 additions and 154 deletions

View file

@ -1,6 +1,6 @@
//! Shared Vectors
import ptr::addr_of;
use ptr::addr_of;
export init_op;
export capacity;

View file

@ -6,7 +6,7 @@
//! Boolean logic
import cmp::Eq;
use cmp::Eq;
export not, and, or, xor, implies;
export eq, ne, is_true, is_false;

View file

@ -4,7 +4,7 @@
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
import cmp::{Eq, Ord};
use cmp::{Eq, Ord};
export ptr_eq;

View file

@ -4,7 +4,7 @@
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
import cmp::Eq;
use cmp::Eq;
/*
Lu Uppercase_Letter an uppercase letter
@ -47,9 +47,9 @@ export is_alphabetic,
to_digit, cmp,
escape_default, escape_unicode;
import is_alphabetic = unicode::derived_property::Alphabetic;
import is_XID_start = unicode::derived_property::XID_Start;
import is_XID_continue = unicode::derived_property::XID_Continue;
use is_alphabetic = unicode::derived_property::Alphabetic;
use is_XID_start = unicode::derived_property::XID_Start;
use is_XID_continue = unicode::derived_property::XID_Continue;
/**

View file

@ -12,9 +12,9 @@ export c_double;
export c_float_targ_consts;
export c_double_targ_consts;
import libc::c_int;
import libc::c_float;
import libc::c_double;
use libc::c_int;
use libc::c_float;
use libc::c_double;
// function names are almost identical to C's libmath, a few have been
// renamed, grep for "rename:"

View file

@ -27,8 +27,8 @@
* ~~~
*/
import either::Either;
import libc::size_t;
use either::Either;
use libc::size_t;
export Port;
export Chan;

View file

@ -2,28 +2,28 @@
// Export various ubiquitous types, constructors, methods.
import option::{Some, None};
import Option = option::Option;
use option::{Some, None};
use Option = option::Option;
// XXX: snapshot rustc is generating code that wants lower-case option
#[cfg(stage0)]
import option = option::Option;
use option = option::Option;
import result::{Result, Ok, Err};
use result::{Result, Ok, Err};
import Path = path::Path;
import GenericPath = path::GenericPath;
import WindowsPath = path::WindowsPath;
import PosixPath = path::PosixPath;
use Path = path::Path;
use GenericPath = path::GenericPath;
use WindowsPath = path::WindowsPath;
use PosixPath = path::PosixPath;
import tuple::{TupleOps, ExtendedTupleOps};
import str::{StrSlice, UniqueStr};
import vec::{ConstVector, CopyableVector, ImmutableVector};
import vec::{ImmutableEqVector, ImmutableCopyableVector};
import iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
import iter::{CopyableOrderedIter, Times, TimesIx};
import num::Num;
import ptr::Ptr;
import to_str::ToStr;
use tuple::{TupleOps, ExtendedTupleOps};
use str::{StrSlice, UniqueStr};
use vec::{ConstVector, CopyableVector, ImmutableVector};
use vec::{ImmutableEqVector, ImmutableCopyableVector};
use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
use iter::{CopyableOrderedIter, Times, TimesIx};
use num::Num;
use ptr::Ptr;
use to_str::ToStr;
export Path, WindowsPath, PosixPath, GenericPath;
export Option, Some, None, unreachable;
@ -44,11 +44,11 @@ export ToStr;
// The compiler has special knowlege of these so we must not duplicate them
// when compiling for testing
#[cfg(notest)]
import ops::{Const, Copy, Send, Owned};
use ops::{Const, Copy, Send, Owned};
#[cfg(notest)]
import ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
use ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
#[cfg(notest)]
import ops::{Shl, Shr, Index};
use ops::{Shl, Shr, Index};
#[cfg(notest)]
export Const, Copy, Send, Owned;
@ -61,11 +61,11 @@ export Shl, Shr, Index;
use coreops(name = "core", vers = "0.4");
#[cfg(test)]
import coreops::ops::{Const, Copy, Send, Owned};
use coreops::ops::{Const, Copy, Send, Owned};
#[cfg(test)]
import coreops::ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
use coreops::ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
#[cfg(test)]
import coreops::ops::{Shl, Shr, Index};
use coreops::ops::{Shl, Shr, Index};
// Export the log levels as global constants. Higher levels mean

View file

@ -9,8 +9,8 @@
//
// Note that recursive use is not permitted.
import unsafe::reinterpret_cast;
import ptr::null;
use unsafe::reinterpret_cast;
use ptr::null;
export DVec;
export from_elem;

View file

@ -4,8 +4,8 @@
//! A type that represents one of two alternatives
import cmp::Eq;
import result::Result;
use cmp::Eq;
use result::Result;
/// The either type
enum Either<T, U> {

View file

@ -26,8 +26,8 @@ debug!("hello, %s!", "world");
*/
import cmp::Eq;
import option::{Some, None};
use cmp::Eq;
use option::{Some, None};
/*

View file

@ -6,8 +6,8 @@
// PORT
import cmath::c_float::*;
import cmath::c_float_targ_consts::*;
use cmath::c_float::*;
use cmath::c_float_targ_consts::*;
export add, sub, mul, div, rem, lt, le, eq, ne, ge, gt;
export is_positive, is_negative, is_nonpositive, is_nonnegative;

View file

@ -6,8 +6,8 @@
// PORT
import cmath::c_double::*;
import cmath::c_double_targ_consts::*;
use cmath::c_double::*;
use cmath::c_double_targ_consts::*;
// Even though this module exports everything defined in it,
// because it contains re-exports, we also have to explicitly

View file

@ -1,4 +1,4 @@
import libc::{c_void, size_t, c_int};
use libc::{c_void, size_t, c_int};
extern mod rustrt {

View file

@ -30,19 +30,19 @@ export j0, j1, jn, y0, y1, yn;
// PORT this must match in width according to architecture
import m_float = f64;
use m_float = f64;
import f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
import f64::logarithm;
import f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
import f64::{erf, erfc, exp, expm1, exp2, abs_sub};
import f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp};
import f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
import f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
import f64::signbit;
import f64::{j0, j1, jn, y0, y1, yn};
import cmp::{Eq, Ord};
import num::from_int;
use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
use f64::logarithm;
use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
use f64::{erf, erfc, exp, expm1, exp2, abs_sub};
use f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp};
use f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
use f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
use f64::signbit;
use f64::{j0, j1, jn, y0, y1, yn};
use cmp::{Eq, Ord};
use num::from_int;
const NaN: float = 0.0/0.0;

View file

@ -15,9 +15,9 @@
* ~~~
*/
import either::Either;
import pipes::recv;
import unsafe::copy_lifetime;
use either::Either;
use pipes::recv;
use unsafe::copy_lifetime;
export Future;
export extensions;

View file

@ -13,9 +13,9 @@
* CPRNG like rand::rng.
*/
import io::Writer;
import io::WriterUtil;
import to_bytes::IterBytes;
use io::Writer;
use io::WriterUtil;
use to_bytes::IterBytes;
export Streaming, State, Hash, HashUtil;
export default_state;

View file

@ -2,10 +2,10 @@
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
import T = inst::T;
import cmp::{Eq, Ord};
import from_str::FromStr;
import num::from_int;
use T = inst::T;
use cmp::{Eq, Ord};
use from_str::FromStr;
use num::from_int;
export min_value, max_value;
export min, max;

View file

@ -4,13 +4,13 @@ Module: io
Basic input/output
*/
import result::Result;
use result::Result;
import cmp::Eq;
import dvec::DVec;
import libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
import libc::consts::os::posix88::*;
import libc::consts::os::extra::*;
use cmp::Eq;
use dvec::DVec;
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
use libc::consts::os::posix88::*;
use libc::consts::os::extra::*;
#[allow(non_camel_case_types)] // not sure what to do about this
type fd_t = c_int;

View file

@ -2,8 +2,8 @@
// workaround our lack of traits and lack of macros. See core.{rc,rs} for
// how this file is used.
import cmp::{Eq, Ord};
import inst::{IMPL_T, EACH, SIZE_HINT};
use cmp::{Eq, Ord};
use inst::{IMPL_T, EACH, SIZE_HINT};
export extensions;
impl<A> IMPL_T<A>: iter::BaseIter<A> {

View file

@ -44,44 +44,44 @@
// FIXME (#2006): change these to glob-exports when sufficiently supported.
import types::common::c95::*;
import types::common::c99::*;
import types::common::posix88::*;
import types::common::posix01::*;
import types::common::posix08::*;
import types::common::bsd44::*;
import types::os::arch::c95::*;
import types::os::arch::c99::*;
import types::os::arch::posix88::*;
import types::os::arch::posix01::*;
import types::os::arch::posix08::*;
import types::os::arch::bsd44::*;
import types::os::arch::extra::*;
use types::common::c95::*;
use types::common::c99::*;
use types::common::posix88::*;
use types::common::posix01::*;
use types::common::posix08::*;
use types::common::bsd44::*;
use types::os::arch::c95::*;
use types::os::arch::c99::*;
use types::os::arch::posix88::*;
use types::os::arch::posix01::*;
use types::os::arch::posix08::*;
use types::os::arch::bsd44::*;
use types::os::arch::extra::*;
import consts::os::c95::*;
import consts::os::c99::*;
import consts::os::posix88::*;
import consts::os::posix01::*;
import consts::os::posix08::*;
import consts::os::bsd44::*;
import consts::os::extra::*;
use consts::os::c95::*;
use consts::os::c99::*;
use consts::os::posix88::*;
use consts::os::posix01::*;
use consts::os::posix08::*;
use consts::os::bsd44::*;
use consts::os::extra::*;
import funcs::c95::ctype::*;
import funcs::c95::stdio::*;
import funcs::c95::stdlib::*;
import funcs::c95::string::*;
use funcs::c95::ctype::*;
use funcs::c95::stdio::*;
use funcs::c95::stdlib::*;
use funcs::c95::string::*;
import funcs::posix88::stat::*;
import funcs::posix88::stdio::*;
import funcs::posix88::fcntl::*;
import funcs::posix88::dirent::*;
import funcs::posix88::unistd::*;
use funcs::posix88::stat::*;
use funcs::posix88::stdio::*;
use funcs::posix88::fcntl::*;
use funcs::posix88::dirent::*;
use funcs::posix88::unistd::*;
import funcs::posix01::unistd::*;
import funcs::posix08::unistd::*;
use funcs::posix01::unistd::*;
use funcs::posix08::unistd::*;
import funcs::bsd44::*;
import funcs::extra::*;
use funcs::bsd44::*;
use funcs::extra::*;
// FIXME (#2006): remove these 3 exports (and their uses next door in os::)
// when export globs work. They provide access (for now) for os:: to dig

View file

@ -12,8 +12,8 @@ mutation when the data structure should be immutable.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
import util::with;
import unsafe::transmute_immut;
use util::with;
use unsafe::transmute_immut;
export Managed;

View file

@ -20,14 +20,14 @@
* to write OS-ignorant code by default.
*/
import libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t,
use libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t,
mode_t, pid_t, FILE};
import libc::{close, fclose};
use libc::{close, fclose};
import option::{Some, None};
use option::{Some, None};
import consts::*;
import task::TaskBuilder;
use consts::*;
use task::TaskBuilder;
export close, fclose, fsync_fd, waitpid;
export env, getenv, setenv, fdopen, pipe;

View file

@ -76,10 +76,10 @@ bounded and unbounded protocols allows for less code duplication.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
import cmp::Eq;
import unsafe::{forget, reinterpret_cast, transmute};
import either::{Either, Left, Right};
import option::unwrap;
use cmp::Eq;
use unsafe::{forget, reinterpret_cast, transmute};
use either::{Either, Left, Right};
use option::unwrap;
// Things used by code generated by the pipe compiler.
export entangle, get_buffer, drop_buffer;

View file

@ -6,8 +6,8 @@
export chan_from_global_ptr, weaken_task;
import compare_and_swap = rustrt::rust_compare_and_swap_ptr;
import task::TaskBuilder;
use compare_and_swap = rustrt::rust_compare_and_swap_ptr;
use task::TaskBuilder;
#[allow(non_camel_case_types)] // runtime type
type rust_port_id = uint;

View file

@ -19,8 +19,8 @@ export buf_len;
export position;
export Ptr;
import cmp::{Eq, Ord};
import libc::{c_void, size_t};
use cmp::{Eq, Ord};
use libc::{c_void, size_t};
#[nolink]
#[abi = "cdecl"]

View file

@ -1,7 +1,7 @@
//! A type representing either success or failure
import cmp::Eq;
import either::Either;
use cmp::Eq;
use either::Either;
/// The result type
enum Result<T, U> {

View file

@ -3,10 +3,10 @@
#[forbid(deprecated_pattern)];
//! Runtime calls emitted by the compiler.
import libc::c_char;
import libc::c_void;
import libc::size_t;
import libc::uintptr_t;
use libc::c_char;
use libc::c_void;
use libc::size_t;
use libc::uintptr_t;
#[allow(non_camel_case_types)]
type rust_task = c_void;

View file

@ -3,9 +3,9 @@
#[forbid(deprecated_pattern)];
//! Process spawning
import option::{Some, None};
import libc::{pid_t, c_void, c_int};
import io::ReaderUtil;
use option::{Some, None};
use libc::{pid_t, c_void, c_int};
use io::ReaderUtil;
export Program;
export run_program;

View file

@ -4,9 +4,9 @@ Sendable hash maps. Very much a work in progress.
*/
import cmp::Eq;
import hash::Hash;
import to_bytes::IterBytes;
use cmp::Eq;
use hash::Hash;
use to_bytes::IterBytes;
trait SendMap<K:Eq Hash, V: copy> {
// FIXME(#3148) ^^^^ once find_ref() works, we can drop V:copy

View file

@ -1,8 +1,8 @@
// NB: Don't rely on other core mods here as this has to move into the rt
import unsafe::reinterpret_cast;
import ptr::offset;
import sys::size_of;
use unsafe::reinterpret_cast;
use ptr::offset;
use sys::size_of;
type Word = uint;

View file

@ -7,9 +7,9 @@
* some heavy-duty uses, try std::rope.
*/
import cmp::{Eq, Ord};
import libc::size_t;
import io::WriterUtil;
use cmp::{Eq, Ord};
use libc::size_t;
use io::WriterUtil;
export
// Creating a string

View file

@ -27,8 +27,8 @@
* ~~~
*/
import cmp::Eq;
import result::Result;
use cmp::Eq;
use result::Result;
export Task;
export TaskResult;

View file

@ -2,7 +2,7 @@
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
import io::Writer;
use io::Writer;
type Cb = fn(buf: &[const u8]) -> bool;

View file

@ -2,9 +2,9 @@
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
import T = inst::T;
import cmp::{Eq, Ord};
import from_str::FromStr;
use T = inst::T;
use cmp::{Eq, Ord};
use from_str::FromStr;
export min_value, max_value;
export min, max;

View file

@ -1,6 +1,6 @@
//! Operations on unique pointer types
import cmp::{Eq, Ord};
use cmp::{Eq, Ord};
impl<T:Eq> ~const T : Eq {
pure fn eq(&&other: ~const T) -> bool { *self == *other }

View file

@ -9,7 +9,7 @@ export unwrap_shared_mutable_state;
export Exclusive, exclusive, unwrap_exclusive;
export copy_lifetime;
import task::atomically;
use task::atomically;
#[abi = "rust-intrinsic"]
extern mod rusti {

View file

@ -1,9 +1,9 @@
//! Vectors
import cmp::{Eq, Ord};
import option::{Some, None};
import ptr::addr_of;
import libc::size_t;
use cmp::{Eq, Ord};
use option::{Some, None};
use ptr::addr_of;
use libc::size_t;
export append;
export append_one;