Skip to content

Commit b8dd0ec

Browse files
committed
---
yaml --- r: 213212 b: refs/heads/auto c: 913c227 h: refs/heads/master v: v3
1 parent 81326a9 commit b8dd0ec

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: c9b40a30c0a8c5776920aec54039d0571e903f5a
13+
refs/heads/auto: 913c2273eba32c7a33e068a5ac68007d7f8419d1
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/liballoc/boxed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ impl<T : ?Sized> Box<T> {
124124
#[unstable(feature = "box_raw",
125125
reason = "may be renamed or moved out of Box scope")]
126126
#[inline]
127+
// NB: may want to be called from_ptr, see comments on CStr::from_ptr
127128
pub unsafe fn from_raw(raw: *mut T) -> Self {
128129
mem::transmute(raw)
129130
}
@@ -147,6 +148,7 @@ impl<T : ?Sized> Box<T> {
147148
/// ```
148149
#[unstable(feature = "box_raw", reason = "may be renamed")]
149150
#[inline]
151+
// NB: may want to be called into_ptr, see comments on CStr::from_ptr
150152
pub fn into_raw(b: Box<T>) -> *mut T {
151153
unsafe { mem::transmute(b) }
152154
}

branches/auto/src/libstd/ffi/c_str.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ impl CString {
206206
/// `into_ptr`. The length of the string will be recalculated
207207
/// using the pointer.
208208
#[unstable(feature = "cstr_memory", reason = "recently added")]
209+
// NB: may want to be called from_raw, needs to consider CStr::from_ptr,
210+
// Box::from_raw (or whatever it's currently called), and
211+
// slice::from_raw_parts
209212
pub unsafe fn from_ptr(ptr: *const libc::c_char) -> CString {
210213
let len = libc::strlen(ptr) + 1; // Including the NUL byte
211214
let slice = slice::from_raw_parts(ptr, len as usize);
@@ -221,6 +224,7 @@ impl CString {
221224
///
222225
/// Failure to call `from_ptr` will lead to a memory leak.
223226
#[unstable(feature = "cstr_memory", reason = "recently added")]
227+
// NB: may want to be called into_raw, see comments on from_ptr
224228
pub fn into_ptr(self) -> *const libc::c_char {
225229
// It is important that the bytes be sized to fit - we need
226230
// the capacity to be determinable from the string length, and

0 commit comments

Comments
 (0)