Skip to content

Commit 4b6864f

Browse files
committed
auto merge of #6226 : alexcrichton/rust/issue-6199, r=brson
I just removed `pub mod` from `core.rc` and then got everything to compile again. One thing I'm worried about is an import like this: ```rust use a; use a::b; mod a { pub type b = int; } mod b { use a; // bad use a::b; // good } ``` I'm not sure if `use a::b` being valid is a bug or intended behavior (same question about `use a`). If it's intended behavior, then I got around these modules not being public by only importing the specific members that are necessary. Otherwise that probably needs an open issue.
2 parents 05460fc + 24cda9f commit 4b6864f

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

src/libcore/char.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use option::{None, Option, Some};
1616
use str;
1717
use u32;
1818
use uint;
19-
use unicode;
19+
use unicode::{derived_property, general_category};
2020

2121
#[cfg(notest)] use cmp::Eq;
2222

@@ -53,18 +53,17 @@ use unicode;
5353
Cn Unassigned a reserved unassigned code point or a noncharacter
5454
*/
5555

56-
pub use is_alphabetic = unicode::derived_property::Alphabetic;
57-
pub use is_XID_start = unicode::derived_property::XID_Start;
58-
pub use is_XID_continue = unicode::derived_property::XID_Continue;
59-
56+
pub fn is_alphabetic(c: char) -> bool { derived_property::Alphabetic(c) }
57+
pub fn is_XID_start(c: char) -> bool { derived_property::XID_Start(c) }
58+
pub fn is_XID_continue(c: char) -> bool { derived_property::XID_Continue(c) }
6059

6160
/**
6261
* Indicates whether a character is in lower case, defined
6362
* in terms of the Unicode General Category 'Ll'
6463
*/
6564
#[inline(always)]
6665
pub fn is_lowercase(c: char) -> bool {
67-
return unicode::general_category::Ll(c);
66+
return general_category::Ll(c);
6867
}
6968

7069
/**
@@ -73,7 +72,7 @@ pub fn is_lowercase(c: char) -> bool {
7372
*/
7473
#[inline(always)]
7574
pub fn is_uppercase(c: char) -> bool {
76-
return unicode::general_category::Lu(c);
75+
return general_category::Lu(c);
7776
}
7877

7978
/**
@@ -84,9 +83,9 @@ pub fn is_uppercase(c: char) -> bool {
8483
#[inline(always)]
8584
pub fn is_whitespace(c: char) -> bool {
8685
return ('\x09' <= c && c <= '\x0d')
87-
|| unicode::general_category::Zs(c)
88-
|| unicode::general_category::Zl(c)
89-
|| unicode::general_category::Zp(c);
86+
|| general_category::Zs(c)
87+
|| general_category::Zl(c)
88+
|| general_category::Zp(c);
9089
}
9190

9291
/**
@@ -96,18 +95,18 @@ pub fn is_whitespace(c: char) -> bool {
9695
*/
9796
#[inline(always)]
9897
pub fn is_alphanumeric(c: char) -> bool {
99-
return unicode::derived_property::Alphabetic(c) ||
100-
unicode::general_category::Nd(c) ||
101-
unicode::general_category::Nl(c) ||
102-
unicode::general_category::No(c);
98+
return derived_property::Alphabetic(c) ||
99+
general_category::Nd(c) ||
100+
general_category::Nl(c) ||
101+
general_category::No(c);
103102
}
104103

105104
/// Indicates whether the character is numeric (Nd, Nl, or No)
106105
#[inline(always)]
107106
pub fn is_digit(c: char) -> bool {
108-
return unicode::general_category::Nd(c) ||
109-
unicode::general_category::Nl(c) ||
110-
unicode::general_category::No(c);
107+
return general_category::Nd(c) ||
108+
general_category::Nl(c) ||
109+
general_category::No(c);
111110
}
112111

113112
/**

src/libcore/core.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ pub mod unstable;
244244

245245
/* For internal use, not exported */
246246

247-
pub mod unicode;
247+
mod unicode;
248248
#[path = "num/cmath.rs"]
249-
pub mod cmath;
250-
pub mod stackwalk;
249+
mod cmath;
250+
mod stackwalk;
251251
#[path = "rt/mod.rs"]
252-
pub mod rt;
252+
mod rt;
253253

254254
// A curious inner-module that's not exported that contains the binding
255255
// 'core' so that macro-expanded references to core::error and such

src/libcore/gc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use libc::{size_t, uintptr_t};
4444
use option::{None, Option, Some};
4545
use ptr;
4646
use hashmap::HashSet;
47-
use stackwalk;
47+
use stackwalk::walk_stack;
4848
use sys;
4949

5050
pub use stackwalk::Word;
@@ -230,7 +230,7 @@ unsafe fn walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) {
230230
// frame is marked by a sentinel, which is a box pointer stored on
231231
// the stack.
232232
let mut reached_sentinel = ptr::is_null(sentinel);
233-
for stackwalk::walk_stack |frame| {
233+
for walk_stack |frame| {
234234
let pc = last_ret;
235235
let Segment {segment: next_segment, boundary: boundary} =
236236
find_segment_for_frame(frame.fp, segment);

0 commit comments

Comments
 (0)