Skip to content

Commit 51152cc

Browse files
committed
De-export private and unicode. Part of #3583.
1 parent cda1d35 commit 51152cc

File tree

2 files changed

+33
-36
lines changed

2 files changed

+33
-36
lines changed

src/libcore/core.rc

-2
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,7 @@ mod rt;
341341

342342
// For internal use, not exported
343343

344-
#[legacy_exports]
345344
mod unicode;
346-
#[legacy_exports]
347345
mod private;
348346
mod cmath;
349347
mod stackwalk;

src/libcore/unicode.rs

+33-34
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
#[forbid(deprecated_mode)];
44
#[forbid(deprecated_pattern)];
55

6-
mod general_category {
7-
#[legacy_exports];
8-
pure fn Cc(c: char) -> bool {
6+
pub mod general_category {
7+
pub pure fn Cc(c: char) -> bool {
98
return match c {
109
'\x00' .. '\x1f'
1110
| '\x7f' .. '\x9f' => true,
1211
_ => false
1312
};
1413
}
1514

16-
pure fn Cf(c: char) -> bool {
15+
pub pure fn Cf(c: char) -> bool {
1716
return match c {
1817
'\xad'
1918
| '\u0600' .. '\u0603'
@@ -32,21 +31,21 @@ mod general_category {
3231
};
3332
}
3433

35-
pure fn Co(c: char) -> bool {
34+
pub pure fn Co(c: char) -> bool {
3635
return match c {
3736
'\ue000' .. '\uf8ff' => true,
3837
_ => false
3938
};
4039
}
4140

42-
pure fn Cs(c: char) -> bool {
41+
pub pure fn Cs(c: char) -> bool {
4342
return match c {
4443
'\ud800' .. '\udfff' => true,
4544
_ => false
4645
};
4746
}
4847

49-
pure fn Ll(c: char) -> bool {
48+
pub pure fn Ll(c: char) -> bool {
5049
return match c {
5150
'\x61' .. '\x7a'
5251
| '\xaa'
@@ -651,7 +650,7 @@ mod general_category {
651650
};
652651
}
653652

654-
pure fn Lm(c: char) -> bool {
653+
pub pure fn Lm(c: char) -> bool {
655654
return match c {
656655
'\u02b0' .. '\u02c1'
657656
| '\u02c6' .. '\u02d1'
@@ -707,7 +706,7 @@ mod general_category {
707706
};
708707
}
709708

710-
pure fn Lo(c: char) -> bool {
709+
pub pure fn Lo(c: char) -> bool {
711710
return match c {
712711
'\u01bb'
713712
| '\u01c0' .. '\u01c3'
@@ -893,7 +892,7 @@ mod general_category {
893892
};
894893
}
895894

896-
pure fn Lt(c: char) -> bool {
895+
pub pure fn Lt(c: char) -> bool {
897896
return match c {
898897
'\u01c5'
899898
| '\u01c8'
@@ -910,7 +909,7 @@ mod general_category {
910909
};
911910
}
912911

913-
pure fn Lu(c: char) -> bool {
912+
pub pure fn Lu(c: char) -> bool {
914913
return match c {
915914
'\x41' .. '\x5a'
916915
| '\xc0' .. '\xd6'
@@ -1502,7 +1501,7 @@ mod general_category {
15021501
};
15031502
}
15041503

1505-
pure fn Mc(c: char) -> bool {
1504+
pub pure fn Mc(c: char) -> bool {
15061505
return match c {
15071506
'\u0903'
15081507
| '\u093b'
@@ -1613,7 +1612,7 @@ mod general_category {
16131612
};
16141613
}
16151614

1616-
pure fn Me(c: char) -> bool {
1615+
pub pure fn Me(c: char) -> bool {
16171616
return match c {
16181617
'\u0488' .. '\u0489'
16191618
| '\u20dd' .. '\u20e0'
@@ -1624,7 +1623,7 @@ mod general_category {
16241623
};
16251624
}
16261625

1627-
pure fn Mn(c: char) -> bool {
1626+
pub pure fn Mn(c: char) -> bool {
16281627
return match c {
16291628
'\u0300' .. '\u036f'
16301629
| '\u0483' .. '\u0487'
@@ -1817,7 +1816,7 @@ mod general_category {
18171816
};
18181817
}
18191818

1820-
pure fn Nd(c: char) -> bool {
1819+
pub pure fn Nd(c: char) -> bool {
18211820
return match c {
18221821
'\x30' .. '\x39'
18231822
| '\u0660' .. '\u0669'
@@ -1861,7 +1860,7 @@ mod general_category {
18611860
};
18621861
}
18631862

1864-
pure fn Nl(c: char) -> bool {
1863+
pub pure fn Nl(c: char) -> bool {
18651864
return match c {
18661865
'\u16ee' .. '\u16f0'
18671866
| '\u2160' .. '\u2182'
@@ -1880,7 +1879,7 @@ mod general_category {
18801879
};
18811880
}
18821881

1883-
pure fn No(c: char) -> bool {
1882+
pub pure fn No(c: char) -> bool {
18841883
return match c {
18851884
'\xb2' .. '\xb3'
18861885
| '\xb9'
@@ -1928,7 +1927,7 @@ mod general_category {
19281927
};
19291928
}
19301929

1931-
pure fn Pc(c: char) -> bool {
1930+
pub pure fn Pc(c: char) -> bool {
19321931
return match c {
19331932
'\x5f'
19341933
| '\u203f' .. '\u2040'
@@ -1941,7 +1940,7 @@ mod general_category {
19411940
};
19421941
}
19431942

1944-
pure fn Pd(c: char) -> bool {
1943+
pub pure fn Pd(c: char) -> bool {
19451944
return match c {
19461945
'\x2d'
19471946
| '\u058a'
@@ -1963,7 +1962,7 @@ mod general_category {
19631962
};
19641963
}
19651964

1966-
pure fn Pe(c: char) -> bool {
1965+
pub pure fn Pe(c: char) -> bool {
19671966
return match c {
19681967
'\x29'
19691968
| '\x5d'
@@ -2040,7 +2039,7 @@ mod general_category {
20402039
};
20412040
}
20422041

2043-
pure fn Pf(c: char) -> bool {
2042+
pub pure fn Pf(c: char) -> bool {
20442043
return match c {
20452044
'\xbb'
20462045
| '\u2019'
@@ -2057,7 +2056,7 @@ mod general_category {
20572056
};
20582057
}
20592058

2060-
pure fn Pi(c: char) -> bool {
2059+
pub pure fn Pi(c: char) -> bool {
20612060
return match c {
20622061
'\xab'
20632062
| '\u2018'
@@ -2075,7 +2074,7 @@ mod general_category {
20752074
};
20762075
}
20772076

2078-
pure fn Po(c: char) -> bool {
2077+
pub pure fn Po(c: char) -> bool {
20792078
return match c {
20802079
'\x21' .. '\x23'
20812080
| '\x25' .. '\x27'
@@ -2208,7 +2207,7 @@ mod general_category {
22082207
};
22092208
}
22102209

2211-
pure fn Ps(c: char) -> bool {
2210+
pub pure fn Ps(c: char) -> bool {
22122211
return match c {
22132212
'\x28'
22142213
| '\x5b'
@@ -2287,7 +2286,7 @@ mod general_category {
22872286
};
22882287
}
22892288

2290-
pure fn Sc(c: char) -> bool {
2289+
pub pure fn Sc(c: char) -> bool {
22912290
return match c {
22922291
'\x24'
22932292
| '\xa2' .. '\xa5'
@@ -2310,7 +2309,7 @@ mod general_category {
23102309
};
23112310
}
23122311

2313-
pure fn Sk(c: char) -> bool {
2312+
pub pure fn Sk(c: char) -> bool {
23142313
return match c {
23152314
'\x5e'
23162315
| '\x60'
@@ -2344,7 +2343,7 @@ mod general_category {
23442343
};
23452344
}
23462345

2347-
pure fn Sm(c: char) -> bool {
2346+
pub pure fn Sm(c: char) -> bool {
23482347
return match c {
23492348
'\x2b'
23502349
| '\x3c' .. '\x3e'
@@ -2415,7 +2414,7 @@ mod general_category {
24152414
};
24162415
}
24172416

2418-
pure fn So(c: char) -> bool {
2417+
pub pure fn So(c: char) -> bool {
24192418
return match c {
24202419
'\xa6' .. '\xa7'
24212420
| '\xa9'
@@ -2534,21 +2533,21 @@ mod general_category {
25342533
};
25352534
}
25362535

2537-
pure fn Zl(c: char) -> bool {
2536+
pub pure fn Zl(c: char) -> bool {
25382537
return match c {
25392538
'\u2028' => true,
25402539
_ => false
25412540
};
25422541
}
25432542

2544-
pure fn Zp(c: char) -> bool {
2543+
pub pure fn Zp(c: char) -> bool {
25452544
return match c {
25462545
'\u2029' => true,
25472546
_ => false
25482547
};
25492548
}
25502549

2551-
pure fn Zs(c: char) -> bool {
2550+
pub pure fn Zs(c: char) -> bool {
25522551
return match c {
25532552
'\x20'
25542553
| '\xa0'
@@ -2567,7 +2566,7 @@ mod general_category {
25672566
mod derived_property {
25682567
#[legacy_exports];
25692568
/// Check if a character has the alphabetic unicode property
2570-
pure fn Alphabetic(c: char) -> bool {
2569+
pub pure fn Alphabetic(c: char) -> bool {
25712570
return match c {
25722571
'\x41' .. '\x5a'
25732572
| '\x61' .. '\x7a'
@@ -3305,7 +3304,7 @@ mod derived_property {
33053304
};
33063305
}
33073306

3308-
pure fn XID_Continue(c: char) -> bool {
3307+
pub pure fn XID_Continue(c: char) -> bool {
33093308
return match c {
33103309
'\x30' .. '\x39'
33113310
| '\x41' .. '\x5a'
@@ -4176,7 +4175,7 @@ mod derived_property {
41764175
};
41774176
}
41784177

4179-
pure fn XID_Start(c: char) -> bool {
4178+
pub pure fn XID_Start(c: char) -> bool {
41804179
return match c {
41814180
'\x41' .. '\x5a'
41824181
| '\x61' .. '\x7a'

0 commit comments

Comments
 (0)