Skip to content

librustc: Terminate name searches at the nearest module scope for paths ... #4226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
extern mod core(vers = "0.5");

#[cfg(cargo)]
extern mod self(name = "cargo", vers = "0.5");
extern mod this(name = "cargo", vers = "0.5");

#[cfg(fuzzer)]
extern mod self(name = "fuzzer", vers = "0.5");
extern mod this(name = "fuzzer", vers = "0.5");

#[cfg(rustdoc)]
extern mod self(name = "rustdoc", vers = "0.5");
extern mod this(name = "rustdoc", vers = "0.5");

#[cfg(rusti)]
extern mod self(name = "rusti", vers = "0.5");
extern mod this(name = "rusti", vers = "0.5");

#[cfg(rustc)]
extern mod self(name = "rustc", vers = "0.5");
extern mod this(name = "rustc", vers = "0.5");

fn main() { self::main() }
fn main() { this::main() }
3 changes: 3 additions & 0 deletions src/libcargo/pgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::os;
use core::run;

fn gpgv(args: ~[~str]) -> { status: int, out: ~str, err: ~str } {
return run::program_output(~"gpgv", args);
}
Expand Down
16 changes: 14 additions & 2 deletions src/libcore/at_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,26 @@
#[forbid(deprecated_pattern)];

use cast::transmute;
use iter;
use libc;
use ptr::addr_of;
use sys;
use uint;
use vec;

/// Code for dealing with @-vectors. This is pretty incomplete, and
/// contains a bunch of duplication from the code for ~-vectors.

#[abi = "cdecl"]
extern mod rustrt {
pub extern mod rustrt {
#[legacy_exports];
fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
++v: **vec::raw::VecRepr,
++n: libc::size_t);
}

#[abi = "rust-intrinsic"]
extern mod rusti {
pub extern mod rusti {
#[legacy_exports];
fn move_val_init<T>(dst: &mut T, -src: T);
}
Expand Down Expand Up @@ -157,6 +162,13 @@ pub mod traits {
pub mod traits {}

pub mod raw {
use at_vec::{rusti, rustrt};
use libc;
use ptr;
use sys;
use uint;
use vec;

pub type VecRepr = vec::raw::VecRepr;
pub type SliceRepr = vec::raw::SliceRepr;

Expand Down
1 change: 1 addition & 0 deletions src/libcore/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

//! Boolean logic

use cmp;
use cmp::Eq;

/// Negation / inverse
Expand Down
4 changes: 4 additions & 0 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#[forbid(deprecated_pattern)];

use cmp::Eq;
use str;
use u32;
use uint;
use unicode;

/*
Lu Uppercase_Letter an uppercase letter
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use task;

// helper for transmutation, shown below.
type RustClosure = (int,int);
struct Handler<T, U:Copy> {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ mod stackwalk;
// 'core' so that macro-expanded references to core::error and such
// can be resolved within libcore.
#[doc(hidden)] // FIXME #3538
mod core {
pub mod core {
pub const error : u32 = 1_u32;
pub const warn : u32 = 2_u32;
pub const info : u32 = 3_u32;
Expand Down
4 changes: 4 additions & 0 deletions src/libcore/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Do not use ==, !=, <, etc on doubly-linked lists -- it may not terminate.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use managed;
use option;
use vec;

type DListLink<T> = Option<DListNode<T>>;

enum DListNode<T> = @{
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/dvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ Note that recursive use is not permitted.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cast;
use cast::reinterpret_cast;
use ptr::null;
use vec;

/**
* A growable, modifiable vector type that accumulates elements into a
Expand Down
3 changes: 3 additions & 0 deletions src/libcore/either.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@

//! A type that represents one of two alternatives

use cmp;
use cmp::Eq;
use result;
use result::Result;
use vec;

/// The either type
#[deriving_eq]
Expand Down
12 changes: 11 additions & 1 deletion src/libcore/extfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ debug!("hello, %s!", "world");

use cmp::Eq;
use option::{Some, None};

use str;

/*
* We have a 'ct' (compile-time) module that parses format strings into a
Expand All @@ -98,6 +98,10 @@ use option::{Some, None};
// Functions used by the fmt extension at compile time
#[doc(hidden)]
pub mod ct {
use char;
use str;
use vec;

pub enum Signedness { Signed, Unsigned, }
pub enum Caseness { CaseUpper, CaseLower, }
pub enum Ty {
Expand Down Expand Up @@ -332,6 +336,12 @@ pub mod ct {
// implement it 0this way, I think.
#[doc(hidden)]
pub mod rt {
use float;
use str;
use sys;
use uint;
use vec;

pub const flag_none : u32 = 0u32;
pub const flag_left_justify : u32 = 0b00000000000001u32;
pub const flag_left_zero_pad : u32 = 0b00000000000010u32;
Expand Down
3 changes: 3 additions & 0 deletions src/libcore/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! Operations and constants for `f32`

use cmp;
use num;

pub use cmath::c_float_utils::*;
pub use cmath::c_float_targ_consts::*;

Expand Down
5 changes: 5 additions & 0 deletions src/libcore/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

//! Operations and constants for `f64`

use cmath;
use cmp;
use libc;
use num;

pub use cmath::c_double_utils::*;
pub use cmath::c_double_targ_consts::*;

Expand Down
3 changes: 3 additions & 0 deletions src/libcore/flate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ Simple compression
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use libc;
use libc::{c_void, size_t, c_int};
use ptr;
use vec;

extern mod rustrt {
fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
Expand Down
9 changes: 7 additions & 2 deletions src/libcore/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@

use m_float = f64;

use cmp::{Eq, Ord};
use f64;
use num;
use num::Num::from_int;
use str;
use uint;

pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
pub use f64::logarithm;
pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
Expand All @@ -35,8 +42,6 @@ pub use f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
pub use f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
pub use f64::signbit;
pub use f64::{j0, j1, jn, y0, y1, yn};
use cmp::{Eq, Ord};
use num::Num::from_int;

pub const NaN: float = 0.0/0.0;

Expand Down
11 changes: 8 additions & 3 deletions src/libcore/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ with destructors.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

pub use stackwalk::Word;
use libc::size_t;
use libc::uintptr_t;
use cast;
use io;
use libc::{size_t, uintptr_t};
use ptr;
use send_map::linear::LinearMap;
use stackwalk;
use sys;

pub use stackwalk::Word;

// Mirrors rust_stack.h stk_seg
struct StackSegment {
Expand Down
7 changes: 5 additions & 2 deletions src/libcore/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
* CPRNG like rand::rng.
*/

use io::Writer;
use io::WriterUtil;
use io;
use io::{Writer, WriterUtil};
use os;
use to_bytes::IterBytes;
use uint;
use vec;

/**
* Types that can meaningfully be hashed should implement this.
Expand Down
6 changes: 6 additions & 0 deletions src/libcore/int-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ use T = inst::T;
#[cfg(stage2)]
use T = self::inst::T;

use char;
use cmp::{Eq, Ord};
use from_str::FromStr;
use iter;
use num;
use num::Num::from_int;
use str;
use uint;
use vec;

pub const bits : uint = inst::bits;
pub const bytes : uint = (inst::bits / 8);
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/int-template/i16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

mod inst {
pub type T = i16;
pub const bits: uint = u16::bits;
}
pub const bits: uint = ::u16::bits;
}
2 changes: 1 addition & 1 deletion src/libcore/int-template/i32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

mod inst {
pub type T = i32;
pub const bits: uint = u32::bits;
pub const bits: uint = ::u32::bits;
}
4 changes: 2 additions & 2 deletions src/libcore/int-template/i64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

mod inst {
pub type T = i64;
pub const bits: uint = u64::bits;
}
pub const bits: uint = ::u64::bits;
}
4 changes: 2 additions & 2 deletions src/libcore/int-template/i8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

mod inst {
pub type T = i8;
pub const bits: uint = u8::bits;
}
pub const bits: uint = ::u8::bits;
}
2 changes: 1 addition & 1 deletion src/libcore/int-template/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub use self::inst::pow;

mod inst {
pub type T = int;
pub const bits: uint = uint::bits;
pub const bits: uint = ::uint::bits;

/// Returns `base` raised to the power of `exponent`
pub fn pow(base: int, exponent: uint) -> int {
Expand Down
12 changes: 12 additions & 0 deletions src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ use result::Result;

use cmp::Eq;
use dvec::DVec;
use int;
use libc;
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
use libc::consts::os::posix88::*;
use libc::consts::os::extra::*;
use option;
use os;
use ptr;
use result;
use str;
use uint;
use vec;

#[allow(non_camel_case_types)] // not sure what to do about this
type fd_t = c_int;
Expand Down Expand Up @@ -1025,6 +1034,9 @@ pub fn read_whole_file(file: &Path) -> Result<~[u8], ~str> {
// fsync related

pub mod fsync {
use libc;
use option;
use os;

pub enum Level {
// whatever fsync does on that platform
Expand Down
1 change: 1 addition & 0 deletions src/libcore/iter-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#[forbid(deprecated_pattern)];

use cmp::{Eq, Ord};
use iter;

#[cfg(stage0)]
use inst::{IMPL_T, EACH, SIZE_HINT};
Expand Down
6 changes: 5 additions & 1 deletion src/libcore/iter-trait/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
// except according to those terms.

mod inst {
use dlist;
use managed;
use option;

#[allow(non_camel_case_types)]
pub type IMPL_T<A> = dlist::DList<A>;

Expand Down Expand Up @@ -45,4 +49,4 @@ mod inst {
pub pure fn SIZE_HINT<A>(self: &IMPL_T<A>) -> Option<uint> {
Some(self.len())
}
}
}
Loading