Skip to content

Commit 44ab00e

Browse files
committed
Revert "librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc"
This reverts commit a8d37af.
1 parent a8d37af commit 44ab00e

File tree

250 files changed

+453
-1342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+453
-1342
lines changed

doc/tutorial.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2284,10 +2284,6 @@ struct level. Note that fields and methods are _public_ by default.
22842284
~~~
22852285
mod farm {
22862286
# use farm;
2287-
# pub type Chicken = int;
2288-
# type Cow = int;
2289-
# enum Human = int;
2290-
# impl Human { fn rest(&self) { } }
22912287
# pub fn make_me_a_farm() -> farm::Farm { farm::Farm { chickens: ~[], cows: ~[], farmer: Human(0) } }
22922288
pub struct Farm {
22932289
priv mut chickens: ~[Chicken],
@@ -2314,8 +2310,12 @@ fn main() {
23142310
farm::feed_animals(&f);
23152311
f.farmer.rest();
23162312
}
2313+
# type Chicken = int;
2314+
# type Cow = int;
2315+
# enum Human = int;
23172316
# fn make_me_a_farm() -> farm::Farm { farm::make_me_a_farm() }
2318-
# fn make_me_a_chicken() -> farm::Chicken { 0 }
2317+
# fn make_me_a_chicken() -> Chicken { 0 }
2318+
# impl Human { fn rest(&self) { } }
23192319
~~~
23202320

23212321
## Crates

src/compiletest/common.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use cmp;
1412

1513
enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, }

src/compiletest/errors.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use common::config;
1412
use io;
1513
use io::ReaderUtil;

src/compiletest/header.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use common;
1412
use common::config;
1513
use io;

src/compiletest/procsrv.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use io;
1412
use io::{ReaderUtil, WriterUtil};
1513
use libc;

src/compiletest/runtest.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use io;
1412
use io::WriterUtil;
1513
use os;

src/compiletest/util.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use io;
1412
use os;
1513
use os::getenv;

src/libcargo/pgp.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use core::os;
12-
use core::path::Path;
1312
use core::run;
1413

1514
fn gpgv(args: ~[~str]) -> { status: int, out: ~str, err: ~str } {

src/libcore/at_vec.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
#[forbid(deprecated_pattern)];
1616

1717
use cast::transmute;
18-
use kinds::Copy;
1918
use iter;
2019
use libc;
21-
use option::Option;
2220
use ptr::addr_of;
2321
use sys;
2422
use uint;
@@ -152,10 +150,6 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
152150

153151
#[cfg(notest)]
154152
pub mod traits {
155-
use at_vec::append;
156-
use kinds::Copy;
157-
use ops::Add;
158-
159153
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
160154
#[inline(always)]
161155
pure fn add(&self, rhs: & &self/[const T]) -> @[T] {
@@ -168,10 +162,8 @@ pub mod traits {
168162
pub mod traits {}
169163

170164
pub mod raw {
171-
use at_vec::{capacity, rusti, rustrt};
172-
use cast::transmute;
165+
use at_vec::{rusti, rustrt};
173166
use libc;
174-
use ptr::addr_of;
175167
use ptr;
176168
use sys;
177169
use uint;

src/libcore/bool.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use bool;
2020
use cmp;
2121
use cmp::Eq;
22-
use option::{None, Option, Some};
2322

2423
/// Negation / inverse
2524
pub pure fn not(v: bool) -> bool { !v }

src/libcore/cast.rs

-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ pub unsafe fn copy_lifetime_vec<S,T>(_ptr: &a/[S], ptr: &T) -> &a/T {
108108

109109
#[cfg(test)]
110110
pub mod tests {
111-
use cast::{bump_box_refcount, reinterpret_cast, transmute};
112-
113111
#[test]
114112
pub fn test_reinterpret_cast() {
115113
assert 1u == unsafe { reinterpret_cast(&1) };

src/libcore/char.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
use char;
1818
use cmp::Eq;
19-
use option::{None, Option, Some};
2019
use str;
2120
use u32;
2221
use uint;

src/libcore/condition.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use prelude::*;
1211
use task;
1312
use task::local_data::{local_data_pop, local_data_set};
1413

src/libcore/core.rc

-5
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ Implicitly, all crates behave as if they included the following prologue:
5353
#[warn(vecs_implicitly_copyable)];
5454
#[deny(non_camel_case_types)];
5555

56-
/* The Prelude. */
57-
58-
pub mod prelude;
5956

6057
/* Primitive types */
6158

@@ -246,8 +243,6 @@ pub mod core {
246243

247244
pub use cmp;
248245
pub use condition;
249-
pub use option;
250-
pub use kinds;
251246
}
252247

253248

src/libcore/dlist.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Do not use ==, !=, <, etc on doubly-linked lists -- it may not terminate.
2222
#[forbid(deprecated_mode)];
2323
#[forbid(deprecated_pattern)];
2424

25-
use kinds::Copy;
2625
use managed;
27-
use option::{None, Option, Some};
2826
use option;
2927
use vec;
3028

@@ -96,13 +94,13 @@ impl<T> DListNode<T> {
9694
}
9795

9896
/// Creates a new dlist node with the given data.
99-
pub pure fn new_dlist_node<T>(data: T) -> DListNode<T> {
97+
pure fn new_dlist_node<T>(data: T) -> DListNode<T> {
10098
DListNode(@{data: move data, mut linked: false,
10199
mut prev: None, mut next: None})
102100
}
103101

104102
/// Creates a new, empty dlist.
105-
pub pure fn DList<T>() -> DList<T> {
103+
pure fn DList<T>() -> DList<T> {
106104
DList_(@{mut size: 0, mut hd: None, mut tl: None})
107105
}
108106

@@ -122,7 +120,7 @@ pub fn from_vec<T: Copy>(vec: &[T]) -> DList<T> {
122120

123121
/// Produce a list from a list of lists, leaving no elements behind in the
124122
/// input. O(number of sub-lists).
125-
pub fn concat<T>(lists: DList<DList<T>>) -> DList<T> {
123+
fn concat<T>(lists: DList<DList<T>>) -> DList<T> {
126124
let result = DList();
127125
while !lists.is_empty() {
128126
result.append(lists.pop().get());
@@ -476,9 +474,7 @@ impl<T: Copy> DList<T> {
476474
mod tests {
477475
#[legacy_exports];
478476

479-
use dlist::{DList, concat, from_vec, new_dlist_node};
480477
use iter;
481-
use option::{None, Some};
482478
use vec;
483479

484480
#[test]

src/libcore/dvec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Note that recursive use is not permitted.
2525

2626
use cast;
2727
use cast::reinterpret_cast;
28-
use prelude::*;
2928
use ptr::null;
3029
use vec;
3130

src/libcore/either.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414

1515
//! A type that represents one of two alternatives
1616
17-
use cmp::Eq;
1817
use cmp;
19-
use kinds::Copy;
20-
use result::Result;
18+
use cmp::Eq;
2119
use result;
20+
use result::Result;
2221
use vec;
2322

2423
/// The either type

src/libcore/extfmt.rs

-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ debug!("hello, %s!", "world");
8282

8383
use cmp::Eq;
8484
use option::{Some, None};
85-
use prelude::*;
8685
use str;
8786

8887
/*
@@ -100,7 +99,6 @@ use str;
10099
#[doc(hidden)]
101100
pub mod ct {
102101
use char;
103-
use prelude::*;
104102
use str;
105103
use vec;
106104

src/libcore/float.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use cmp;
3131
use f64;
3232
use num;
3333
use num::Num::from_int;
34-
use option::{None, Option, Some};
3534
use str;
3635
use uint;
3736

src/libcore/gc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ with destructors.
4242
use cast;
4343
use io;
4444
use libc::{size_t, uintptr_t};
45-
use option::{None, Option, Some};
4645
use ptr;
4746
use send_map::linear::LinearMap;
4847
use stackwalk;

src/libcore/int-template.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use from_str::FromStr;
2121
use iter;
2222
use num;
2323
use num::Num::from_int;
24-
use prelude::*;
2524
use str;
2625
use uint;
2726
use vec;

src/libcore/int-template/int.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ mod inst {
5050

5151
#[test]
5252
fn test_overflows() {
53-
assert (::int::max_value > 0);
54-
assert (::int::min_value <= 0);
55-
assert (::int::min_value + ::int::max_value + 1 == 0);
53+
assert (max_value > 0);
54+
assert (min_value <= 0);
55+
assert (min_value + max_value + 1 == 0);
5656
}
5757
}

src/libcore/io.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ use libc::consts::os::posix88::*;
2828
use libc::consts::os::extra::*;
2929
use option;
3030
use os;
31-
use prelude::*;
3231
use ptr;
3332
use result;
3433
use str;
3534
use uint;
3635
use vec;
3736

3837
#[allow(non_camel_case_types)] // not sure what to do about this
39-
pub type fd_t = c_int;
38+
type fd_t = c_int;
4039

4140
#[abi = "cdecl"]
4241
extern mod rustrt {
@@ -453,12 +452,12 @@ impl<T: Reader, C> {base: T, cleanup: C}: Reader {
453452
fn tell(&self) -> uint { self.base.tell() }
454453
}
455454

456-
pub struct FILERes {
455+
struct FILERes {
457456
f: *libc::FILE,
458457
drop { libc::fclose(self.f); }
459458
}
460459

461-
pub fn FILERes(f: *libc::FILE) -> FILERes {
460+
fn FILERes(f: *libc::FILE) -> FILERes {
462461
FILERes {
463462
f: f
464463
}
@@ -630,12 +629,12 @@ impl fd_t: Writer {
630629
}
631630
}
632631

633-
pub struct FdRes {
632+
struct FdRes {
634633
fd: fd_t,
635634
drop { libc::close(self.fd); }
636635
}
637636

638-
pub fn FdRes(fd: fd_t) -> FdRes {
637+
fn FdRes(fd: fd_t) -> FdRes {
639638
FdRes {
640639
fd: fd
641640
}
@@ -1029,10 +1028,7 @@ pub fn read_whole_file(file: &Path) -> Result<~[u8], ~str> {
10291028
// fsync related
10301029

10311030
pub mod fsync {
1032-
use io::{FILERes, FdRes, fd_t};
1033-
use kinds::Copy;
10341031
use libc;
1035-
use option::Option;
10361032
use option;
10371033
use os;
10381034

@@ -1117,11 +1113,8 @@ pub mod fsync {
11171113

11181114
#[cfg(test)]
11191115
mod tests {
1120-
use debug;
11211116
use i32;
1122-
use io::{BytesWriter, SeekCur, SeekEnd, SeekSet};
11231117
use io;
1124-
use path::Path;
11251118
use result;
11261119
use str;
11271120
use u64;

src/libcore/iter-trait.rs

-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
#[forbid(deprecated_pattern)];
1717

1818
use cmp::{Eq, Ord};
19-
use iter::BaseIter;
2019
use iter;
21-
use kinds::Copy;
22-
use option::Option;
2320

2421
use self::inst::{IMPL_T, EACH, SIZE_HINT};
2522

src/libcore/iter-trait/dlist.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
mod inst {
1212
use dlist;
1313
use managed;
14-
use option::{Option, Some};
1514
use option;
1615

1716
#[allow(non_camel_case_types)]

src/libcore/iter-trait/dvec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
mod inst {
1212
use dvec;
13-
use option::{Option, Some};
1413

1514
#[allow(non_camel_case_types)]
1615
pub type IMPL_T<A> = dvec::DVec<A>;

0 commit comments

Comments
 (0)