Skip to content

Commit 107bf96

Browse files
committed
librustc: Mark all type implementations public. rs=impl-publicity
1 parent b171d0e commit 107bf96

File tree

114 files changed

+175
-175
lines changed

Some content is hidden

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

114 files changed

+175
-175
lines changed

src/libcore/cell.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub pure fn empty_cell<T>() -> Cell<T> {
2828
Cell { value: None }
2929
}
3030

31-
impl<T> Cell<T> {
31+
pub impl<T> Cell<T> {
3232
/// Yields the value, failing if the cell is empty.
3333
fn take() -> T {
3434
if self.is_empty() {

src/libcore/comm.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub fn PortSet<T: Owned>() -> PortSet<T>{
190190
}
191191
}
192192
193-
impl<T: Owned> PortSet<T> {
193+
pub impl<T: Owned> PortSet<T> {
194194
195195
fn add(port: Port<T>) {
196196
self.ports.push(port)
@@ -323,12 +323,12 @@ pub fn oneshot<T: Owned>() -> (PortOne<T>, ChanOne<T>) {
323323
(port, chan)
324324
}
325325
326-
impl<T: Owned> PortOne<T> {
326+
pub impl<T: Owned> PortOne<T> {
327327
fn recv(self) -> T { recv_one(self) }
328328
fn try_recv(self) -> Option<T> { try_recv_one(self) }
329329
}
330330
331-
impl<T: Owned> ChanOne<T> {
331+
pub impl<T: Owned> ChanOne<T> {
332332
fn send(self, data: T) { send_one(self, data) }
333333
fn try_send(self, data: T) -> bool { try_send_one(self, data) }
334334
}

src/libcore/condition.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct Condition<T, U> {
2525
key: task::local_data::LocalDataKey<Handler<T, U>>
2626
}
2727

28-
impl<T, U> Condition<T, U> {
28+
pub impl<T, U> Condition<T, U> {
2929
fn trap(&self, h: &self/fn(T) -> U) -> Trap/&self<T, U> {
3030
unsafe {
3131
let p : *RustClosure = ::cast::transmute(&h);
@@ -69,7 +69,7 @@ struct Trap<T, U> {
6969
handler: @Handler<T, U>
7070
}
7171

72-
impl<T, U> Trap<T, U> {
72+
pub impl<T, U> Trap<T, U> {
7373
fn in<V>(&self, inner: &self/fn() -> V) -> V {
7474
unsafe {
7575
let _g = Guard { cond: self.cond };

src/libcore/dlist.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ priv impl<T> DListNode<T> {
6262
}
6363
}
6464
65-
impl<T> DListNode<T> {
65+
pub impl<T> DListNode<T> {
6666
/// Get the next node in the list, if there is one.
6767
pure fn next_link(@mut self) -> DListLink<T> {
6868
self.assert_links();
@@ -208,7 +208,7 @@ priv impl<T> DList<T> {
208208
}
209209
}
210210
211-
impl<T> DList<T> {
211+
pub impl<T> DList<T> {
212212
/// Get the size of the list. O(1).
213213
pure fn len(@mut self) -> uint { self.size }
214214
/// Returns true if the list is empty. O(1).
@@ -457,7 +457,7 @@ impl<T> DList<T> {
457457
}
458458
}
459459

460-
impl<T:Copy> DList<T> {
460+
pub impl<T:Copy> DList<T> {
461461
/// Remove data from the head of the list. O(1).
462462
fn pop(@mut self) -> Option<T> {
463463
self.pop_n().map(|nobe| nobe.data)

src/libcore/dvec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ priv impl<A> DVec<A> {
117117
// In theory, most everything should work with any A, but in practice
118118
// almost nothing works without the copy bound due to limitations
119119
// around closures.
120-
impl<A> DVec<A> {
120+
pub impl<A> DVec<A> {
121121
/// Reserves space for N elements
122122
fn reserve(count: uint) {
123123
vec::reserve(&mut self.data, count)
@@ -215,7 +215,7 @@ impl<A> DVec<A> {
215215
}
216216
}
217217
218-
impl<A:Copy> DVec<A> {
218+
pub impl<A:Copy> DVec<A> {
219219
/**
220220
* Append all elements of a vector to the end of the list
221221
*

src/libcore/mutable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn unwrap<T>(m: Mut<T>) -> T {
4343
value
4444
}
4545

46-
impl<T> Data<T> {
46+
pub impl<T> Data<T> {
4747
fn borrow_mut<R>(op: &fn(t: &mut T) -> R) -> R {
4848
match self.mode {
4949
Immutable => fail!(fmt!("%? currently immutable",

src/libcore/option.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub pure fn expect<T>(opt: Option<T>, reason: &str) -> T {
281281
}
282282
}
283283
284-
impl<T> Option<T> {
284+
pub impl<T> Option<T> {
285285
/// Returns true if the option equals `none`
286286
#[inline(always)]
287287
pure fn is_none(&self) -> bool { is_none(self) }
@@ -393,7 +393,7 @@ impl<T> Option<T> {
393393
pure fn expect(self, reason: &str) -> T { expect(self, reason) }
394394
}
395395
396-
impl<T:Copy> Option<T> {
396+
pub impl<T:Copy> Option<T> {
397397
/**
398398
Gets the value out of an option
399399
@@ -421,7 +421,7 @@ impl<T:Copy> Option<T> {
421421
}
422422
}
423423
424-
impl<T:Copy + Zero> Option<T> {
424+
pub impl<T:Copy + Zero> Option<T> {
425425
#[inline(always)]
426426
pure fn get_or_zero(self) -> T { get_or_zero(self) }
427427
}

src/libcore/path.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ mod stat {
241241
}
242242

243243

244-
impl Path {
244+
pub impl Path {
245245
fn stat(&self) -> Option<libc::stat> {
246246
unsafe {
247247
do str::as_c_str(self.to_str()) |buf| {
@@ -290,7 +290,7 @@ impl Path {
290290
#[cfg(target_os = "freebsd")]
291291
#[cfg(target_os = "linux")]
292292
#[cfg(target_os = "macos")]
293-
impl Path {
293+
pub impl Path {
294294
fn get_atime(&self) -> Option<(i64, int)> {
295295
match self.stat() {
296296
None => None,
@@ -324,7 +324,7 @@ impl Path {
324324

325325
#[cfg(target_os = "freebsd")]
326326
#[cfg(target_os = "macos")]
327-
impl Path {
327+
pub impl Path {
328328
fn get_birthtime(&self) -> Option<(i64, int)> {
329329
match self.stat() {
330330
None => None,
@@ -337,7 +337,7 @@ impl Path {
337337
}
338338

339339
#[cfg(target_os = "win32")]
340-
impl Path {
340+
pub impl Path {
341341
fn get_atime(&self) -> Option<(i64, int)> {
342342
match self.stat() {
343343
None => None,

src/libcore/pipes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ pub fn SendPacketBuffered<T,Tbuffer>(p: *Packet<T>)
800800
}
801801
}
802802
803-
impl<T,Tbuffer> SendPacketBuffered<T,Tbuffer> {
803+
pub impl<T,Tbuffer> SendPacketBuffered<T,Tbuffer> {
804804
fn unwrap() -> *Packet<T> {
805805
let mut p = None;
806806
p <-> self.p;
@@ -857,7 +857,7 @@ impl<T:Owned,Tbuffer:Owned> ::ops::Drop for RecvPacketBuffered<T,Tbuffer> {
857857
}
858858
}
859859
860-
impl<T:Owned,Tbuffer:Owned> RecvPacketBuffered<T, Tbuffer> {
860+
pub impl<T:Owned,Tbuffer:Owned> RecvPacketBuffered<T, Tbuffer> {
861861
fn unwrap() -> *Packet<T> {
862862
let mut p = None;
863863
p <-> self.p;

src/libcore/private.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ fn LittleLock() -> LittleLock {
335335
}
336336
}
337337
338-
impl LittleLock {
338+
pub impl LittleLock {
339339
#[inline(always)]
340340
unsafe fn lock<T>(f: fn() -> T) -> T {
341341
struct Unlock {
@@ -381,7 +381,7 @@ impl<T:Owned> Clone for Exclusive<T> {
381381
}
382382
}
383383
384-
impl<T:Owned> Exclusive<T> {
384+
pub impl<T:Owned> Exclusive<T> {
385385
// Exactly like std::arc::mutex_arc,access(), but with the little_lock
386386
// instead of a proper mutex. Same reason for being unsafe.
387387
//

src/libcore/private/extfmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub mod ct {
142142
next: uint
143143
}
144144

145-
impl<T> Parsed<T> {
145+
pub impl<T> Parsed<T> {
146146
static pure fn new(val: T, next: uint) -> Parsed<T> {
147147
Parsed {val: val, next: next}
148148
}

src/libcore/rand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub struct Weighted<T> {
141141
}
142142

143143
/// Extension methods for random number generators
144-
impl Rng {
144+
pub impl Rng {
145145
/// Return a random value for a Rand type
146146
fn gen<T:Rand>() -> T {
147147
Rand::rand(self)

src/libcore/reflect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
4545
MovePtrAdaptor { inner: v }
4646
}
4747

48-
impl<V:TyVisitor + MovePtr> MovePtrAdaptor<V> {
48+
pub impl<V:TyVisitor + MovePtr> MovePtrAdaptor<V> {
4949
#[inline(always)]
5050
fn bump(sz: uint) {
5151
do self.inner.move_ptr() |p| {

src/libcore/repr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl MovePtr for ReprVisitor {
167167
}
168168
}
169169

170-
impl ReprVisitor {
170+
pub impl ReprVisitor {
171171

172172
// Various helpers for the TyVisitor impl
173173

src/libcore/result.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub pure fn map_err<T:Copy,E,F:Copy>(res: &Result<T, E>, op: fn(&E) -> F)
228228
}
229229
}
230230
231-
impl<T, E> Result<T, E> {
231+
pub impl<T, E> Result<T, E> {
232232
#[inline(always)]
233233
pure fn get_ref(&self) -> &self/T { get_ref(self) }
234234
@@ -261,7 +261,7 @@ impl<T, E> Result<T, E> {
261261
}
262262
}
263263
264-
impl<T:Copy,E> Result<T, E> {
264+
pub impl<T:Copy,E> Result<T, E> {
265265
#[inline(always)]
266266
pure fn get(&self) -> T { get(self) }
267267
@@ -271,7 +271,7 @@ impl<T:Copy,E> Result<T, E> {
271271
}
272272
}
273273
274-
impl<T, E: Copy> Result<T, E> {
274+
pub impl<T, E: Copy> Result<T, E> {
275275
#[inline(always)]
276276
pure fn get_err(&self) -> E { get_err(self) }
277277

src/libcore/task/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ priv impl TaskBuilder {
232232
}
233233
}
234234
235-
impl TaskBuilder {
235+
pub impl TaskBuilder {
236236
/**
237237
* Decouple the child task's failure from the parent's. If either fails,
238238
* the other will not be killed.

src/librustc/middle/astencode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn reserve_id_range(sess: Session,
167167
ast_util::id_range { min: to_id_min, max: to_id_min }
168168
}
169169

170-
impl ExtendedDecodeContext {
170+
pub impl ExtendedDecodeContext {
171171
fn tr_id(&self, id: ast::node_id) -> ast::node_id {
172172
/*!
173173
*

src/librustc/middle/borrowck/check_loans.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ enum assignment_type {
8989
at_swap
9090
}
9191

92-
impl assignment_type {
92+
pub impl assignment_type {
9393
fn checked_by_liveness(&self) -> bool {
9494
// the liveness pass guarantees that immutable local variables
9595
// are only assigned once; but it doesn't consider &mut
@@ -106,7 +106,7 @@ impl assignment_type {
106106
}
107107
}
108108
109-
impl CheckLoanCtxt {
109+
pub impl CheckLoanCtxt {
110110
fn tcx(@mut self) -> ty::ctxt { self.bccx.tcx }
111111
112112
fn purity(@mut self, scope_id: ast::node_id) -> Option<purity_cause> {

src/librustc/middle/borrowck/gather_loans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ fn req_loans_in_expr(ex: @ast::expr,
289289
self.root_ub = old_root_ub;
290290
}
291291

292-
impl GatherLoanCtxt {
292+
pub impl GatherLoanCtxt {
293293
fn tcx(@mut self) -> ty::ctxt { self.bccx.tcx }
294294

295295
fn guarantee_adjustments(@mut self,

src/librustc/middle/borrowck/loan.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct LoanContext {
8787
loans: ~[Loan]
8888
}
8989

90-
impl LoanContext {
90+
pub impl LoanContext {
9191
fn tcx(&self) -> ty::ctxt { self.bccx.tcx }
9292

9393
fn loan(&mut self,

src/librustc/middle/borrowck/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ pub fn save_and_restore_managed<T:Copy,U>(save_and_restore_t: @mut T,
433433
u
434434
}
435435

436-
impl LoanKind {
436+
pub impl LoanKind {
437437
fn is_freeze(&self) -> bool {
438438
match *self {
439439
TotalFreeze | PartialFreeze => true,

src/librustc/middle/borrowck/preserve.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub enum PreserveCondition {
3535
PcIfPure(bckerr)
3636
}
3737

38-
impl PreserveCondition {
38+
pub impl PreserveCondition {
3939
// combines two preservation conditions such that if either of
4040
// them requires purity, the result requires purity
4141
fn combine(&self, pc: PreserveCondition) -> PreserveCondition {
@@ -46,7 +46,7 @@ impl PreserveCondition {
4646
}
4747
}
4848

49-
impl BorrowckCtxt {
49+
pub impl BorrowckCtxt {
5050
fn preserve(&self,
5151
cmt: cmt,
5252
scope_region: ty::Region,
@@ -80,7 +80,7 @@ struct PreserveCtxt {
8080
root_managed_data: bool
8181
}
8282

83-
impl PreserveCtxt {
83+
pub impl PreserveCtxt {
8484
fn tcx(&self) -> ty::ctxt { self.bccx.tcx }
8585

8686
fn preserve(&self, cmt: cmt) -> bckres<PreserveCondition> {

src/librustc/middle/lang_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ struct LanguageItemCollector {
322322
item_refs: HashMap<@~str, uint>,
323323
}
324324

325-
impl LanguageItemCollector {
325+
pub impl LanguageItemCollector {
326326
fn match_and_collect_meta_item(&self, item_def_id: def_id,
327327
meta_item: meta_item) {
328328
match meta_item.node {

src/librustc/middle/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ struct Context {
331331
sess: Session
332332
}
333333

334-
impl Context {
334+
pub impl Context {
335335
fn get_level(&self, lint: lint) -> level {
336336
get_lint_level(self.curr, lint)
337337
}

0 commit comments

Comments
 (0)