Skip to content

Commit be2a749

Browse files
committed
---
yaml --- r: 151378 b: refs/heads/try2 c: 645b157 h: refs/heads/master v: v3
1 parent b55945c commit be2a749

File tree

4 files changed

+12
-46
lines changed

4 files changed

+12
-46
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: dca8a0d6e4d1848ead898b3fa5b1e6c940c85b87
8+
refs/heads/try2: 645b1575641209b63d55ff711f83193465f8e082
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@
2525

2626
pub mod intrinsics;
2727
pub mod mem;
28+
pub mod ptr;

branches/try2/src/libstd/ptr.rs renamed to branches/try2/src/libcore/ptr.rs

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,12 @@
9292
9393
use cast;
9494
use clone::Clone;
95-
#[cfg(not(test))]
96-
use cmp::Equiv;
95+
use intrinsics;
9796
use iter::{range, Iterator};
9897
use mem;
99-
use option::{Option, Some, None};
100-
use intrinsics;
98+
use option::{Some, None, Option};
10199

102-
#[cfg(not(test))] use cmp::{Eq, TotalEq, Ord};
100+
#[cfg(not(test))] use cmp::{Eq, TotalEq, Ord, Equiv};
103101

104102
/// Return the offset of the first null pointer in `buf`.
105103
#[inline]
@@ -377,7 +375,9 @@ impl<T> RawPtr<T> for *mut T {
377375
fn to_uint(&self) -> uint { *self as uint }
378376

379377
#[inline]
380-
unsafe fn offset(self, count: int) -> *mut T { intrinsics::offset(self as *T, count) as *mut T }
378+
unsafe fn offset(self, count: int) -> *mut T {
379+
intrinsics::offset(self as *T, count) as *mut T
380+
}
381381

382382
#[inline]
383383
unsafe fn to_option(&self) -> Option<&T> {
@@ -444,10 +444,6 @@ mod externfnpointers {
444444
let other_: *() = unsafe { cast::transmute(*other) };
445445
self_ == other_
446446
}
447-
#[inline]
448-
fn ne(&self, other: &extern "C" fn() -> _R) -> bool {
449-
!self.eq(other)
450-
}
451447
}
452448
macro_rules! fnptreq(
453449
($($p:ident),*) => {
@@ -458,10 +454,6 @@ mod externfnpointers {
458454
let other_: *() = unsafe { cast::transmute(*other) };
459455
self_ == other_
460456
}
461-
#[inline]
462-
fn ne(&self, other: &extern "C" fn($($p),*) -> _R) -> bool {
463-
!self.eq(other)
464-
}
465457
}
466458
}
467459
)
@@ -476,41 +468,13 @@ mod externfnpointers {
476468
#[cfg(not(test))]
477469
impl<T> Ord for *T {
478470
#[inline]
479-
fn lt(&self, other: &*T) -> bool {
480-
*self < *other
481-
}
482-
#[inline]
483-
fn le(&self, other: &*T) -> bool {
484-
*self <= *other
485-
}
486-
#[inline]
487-
fn ge(&self, other: &*T) -> bool {
488-
*self >= *other
489-
}
490-
#[inline]
491-
fn gt(&self, other: &*T) -> bool {
492-
*self > *other
493-
}
471+
fn lt(&self, other: &*T) -> bool { *self < *other }
494472
}
495473

496474
#[cfg(not(test))]
497475
impl<T> Ord for *mut T {
498476
#[inline]
499-
fn lt(&self, other: &*mut T) -> bool {
500-
*self < *other
501-
}
502-
#[inline]
503-
fn le(&self, other: &*mut T) -> bool {
504-
*self <= *other
505-
}
506-
#[inline]
507-
fn ge(&self, other: &*mut T) -> bool {
508-
*self >= *other
509-
}
510-
#[inline]
511-
fn gt(&self, other: &*mut T) -> bool {
512-
*self > *other
513-
}
477+
fn lt(&self, other: &*mut T) -> bool { *self < *other }
514478
}
515479

516480
#[cfg(test)]

branches/try2/src/libstd/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ extern crate core;
135135

136136
pub use core::intrinsics;
137137
pub use core::mem;
138+
pub use core::ptr;
138139

139140
// Run tests with libgreen instead of libnative.
140141
//
@@ -191,7 +192,7 @@ pub mod strbuf;
191192

192193
pub mod ascii;
193194

194-
pub mod ptr;
195+
pub mod owned;
195196
mod managed;
196197
mod reference;
197198
pub mod rc;

0 commit comments

Comments
 (0)