diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-06-11 11:26:16 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-06-17 09:07:17 -0700 |
| commit | 913c2273eba32c7a33e068a5ac68007d7f8419d1 (patch) | |
| tree | f5c6bd762c1826a00a063a97074895c814140b45 /src/liballoc | |
| parent | c9b40a30c0a8c5776920aec54039d0571e903f5a (diff) | |
| download | rust-913c2273eba32c7a33e068a5ac68007d7f8419d1.tar.gz rust-913c2273eba32c7a33e068a5ac68007d7f8419d1.zip | |
Add comment about stabilizing CString::from_ptr
This naming needs to consider the raw vs ptr naming of Box/CStr/CString/slice/etc.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 1a360ebc05c..1039756363e 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -124,6 +124,7 @@ impl<T : ?Sized> Box<T> { #[unstable(feature = "box_raw", reason = "may be renamed or moved out of Box scope")] #[inline] + // NB: may want to be called from_ptr, see comments on CStr::from_ptr pub unsafe fn from_raw(raw: *mut T) -> Self { mem::transmute(raw) } @@ -147,6 +148,7 @@ impl<T : ?Sized> Box<T> { /// ``` #[unstable(feature = "box_raw", reason = "may be renamed")] #[inline] + // NB: may want to be called into_ptr, see comments on CStr::from_ptr pub fn into_raw(b: Box<T>) -> *mut T { unsafe { mem::transmute(b) } } |
