about summary refs log tree commit diff
path: root/src/libstd/ffi
AgeCommit message (Collapse)AuthorLines
2019-08-09Add FIXME-s that some types should be transparentMikail Bagishov-0/+12
2019-08-02Remove extraneous {} in use stmts in doc comments.Bruce Mitchener-2/+2
2019-07-14Auto merge of #62610 - Stargateur:fix-miri-error-cstring-into_inner, r=RalfJungbors-5/+6
Fix miri error in into_inner() of CString Fix #62553 I choice to not transmute because I think it's more unsafe and in case the structure change this code should always work. r? @RalfJung
2019-07-13Fix miri error in into_inner() of CStringAntoine PLASKOWSKI-5/+6
2019-07-07Add missing urls for osstrGuillaume Gomez-3/+4
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-1/+1
Clone for it.
2019-05-20Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPCMazdak Farrokhzad-0/+2
Fix intra-doc link resolution failure on re-exporting libstd Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366). ```rust pub use std::*; ``` Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates. Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.) r? @QuietMisdreavus
2019-05-04Fix intra-doc link resolution failure on re-exporting libstdTaiki Endo-0/+2
2019-05-01as_ptr returns a read-only pointerRalf Jung-2/+7
2019-04-04Mark unix::ffi::OsStrExt methods as inlineKonrad Borowski-0/+1
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-11/+11
2019-03-09Use lifetime contravariance to elide more lifetimes in core+alloc+stdScott McMurray-14/+14
2019-02-28libstd => 2018Taiki Endo-34/+34
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-4/+4
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-17Use more impl header lifetime elisionScott McMurray-4/+4
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-10libs: doc commentsAlexander Regueiro-2/+2
2019-02-10tests: doc commentsAlexander Regueiro-1/+1
2019-01-07Use correct tracking issue for c_variadicRyan Hunt-1/+1
Fixes #57306
2018-12-25Remove licensesMark Rousskov-30/+0
2018-12-15Rollup merge of #56731 - GuillaumeGomez:ffi-doc-urls, r=CentrilPietro Albini-13/+15
Add missing urls in ffi module docs r? @QuietMisdreavus
2018-12-14Auto merge of #56536 - alexcrichton:update-master, r=Mark-Simulacrumbors-1/+0
Bump to 1.33.0 * Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations
2018-12-12use actual invalid string in OsStr::to_string_lossy exampleLyndon Brown-8/+33
2018-12-12Bump to 1.33.0Alex Crichton-1/+0
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-11Add missing urls in ffi module docsGuillaume Gomez-13/+15
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-6/+6
2018-12-04cleanup: remove static lifetimes from consts in libstdljedrz-2/+2
2018-12-03Rollup merge of #56432 - ordovicia:shrink-to-issue, r=Centrilkennytm-1/+1
Update issue number of `shrink_to` methods to point the tracking issue Tracking issue: #56431
2018-12-03Rollup merge of #56141 - jnqnfe:osstr_len_clarity, r=nagisakennytm-6/+18
[std] Osstr len clarity
2018-12-02Update issue number of `shrink_to` methods to point the tracking issueHidehito Yabuuchi-1/+1
2018-11-29Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddybbors-0/+7
libcore: Add VaList and variadic arg handling intrinsics ## Summary - Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`. - Add `core::va_list::VaList` to `libcore`. Part 1 of (at least) 3 for #44930 Comments and critiques are very much welcomed 😄
2018-11-27Fix a typo in the documentation of std::ffipolyfloyd-2/+2
2018-11-26libcore: Add va_list lang item and intrinsicsDan Robertson-0/+7
- Add the llvm intrinsics used to manipulate a va_list. - Add the va_list lang item in order to allow implementing VaList in libcore.
2018-11-21OsStr: clarify `len()` method documentationLyndon Brown-6/+11
2018-11-21OsString: mention storage form in discussionLyndon Brown-0/+7
Helps users to understand capacity related values, which may surpise on Windows. Also is a step towards clarifying understanding of `OsStr`'s len() return value.
2018-11-12Auto merge of #55278 - Centril:constification-1, r=alexcrichtonbors-1/+1
Minor standard library constification This PR makes some bits of the standard library into `const fn`s. I've tried to be as aggressive as I possibly could in the constification. The list is rather small due to how restrictive `const fn` is at the moment. r? @oli-obk cc @rust-lang/libs Stable public APIs affected: + [x] `Cell::as_ptr` + [x] `UnsafeCell::get` + [x] `char::is_ascii` + [x] `iter::empty` + [x] `ManuallyDrop::{new, into_inner}` + [x] `RangeInclusive::{start, end}` + [x] `NonNull::as_ptr` + [x] `{[T], str}::as_ptr` + [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}` + [x] `CStr::as_ptr` + [x] `Ipv4Addr::is_unspecified` + [x] `Ipv6Addr::new` + [x] `Ipv6Addr::octets` Unstable public APIs affected: + [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}` + [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}` + [x] `core::convert::identity` -------------------------- ## Removed from list in first pass: Stable public APIs affected: + [ ] `BTree{Map, Set}::{len, is_empty}` + [ ] `VecDeque::is_empty` + [ ] `String::{is_empty, len}` + [ ] `FromUtf8Error::utf8_error` + [ ] `Vec<T>::{is_empty, len}` + [ ] `Layout::size` + [ ] `DecodeUtf16Error::unpaired_surrogate` + [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}` + [ ] `panic::Location::{file, line, column}` + [ ] `{ChunksExact, RChunksExact}::remainder` + [ ] `Utf8Error::valid_up_to` + [ ] `VacantEntry::key` + [ ] `NulError::nul_position` + [ ] `IntoStringError::utf8_error` + [ ] `IntoInnerError::error` + [ ] `io::Chain::get_ref` + [ ] `io::Take::{limit, get_ref}` + [ ] `SocketAddrV6::{flowinfo, scope_id}` + [ ] `PrefixComponent::{kind, as_os_str}` + [ ] `Path::{ancestors, display}` + [ ] `WaitTimeoutResult::timed_out` + [ ] `Receiver::{iter, try_iter}` + [ ] `thread::JoinHandle::thread` + [ ] `SystemTimeError::duration` Unstable public APIs affected: + [ ] `core::fmt::Arguments::new_v1` + [ ] `core::fmt::Arguments::new_v1_formatted` + [ ] `Pin::{get_ref, into_ref}` + [ ] `Utf8Lossy::chunks` + [ ] `LocalWaker::as_waker` + [ ] `panic::PanicInfo::{internal_constructor, message, location}` + [ ] `panic::Location::{internal_constructor }` ## Removed from list in 2nd pass: Stable public APIs affected: + [ ] `LinkedList::{new, iter, is_empty, len}` + [ ] `mem::forget` + [ ] `Cursor::{new, get_ref, position}` + [ ] `io::{empty, repeat, sink}` + [ ] `PoisonError::new` + [ ] `thread::Builder::new` + [ ] `process::Stdio::{piped, inherit, null}` Unstable public APIs affected: + [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-10Fix documentation typos.Bruce Mitchener-1/+1
2018-11-10revert making internal APIs const fn.Mazdak Farrokhzad-2/+2
2018-11-10reduce list to functions callable in const ctx.Mazdak Farrokhzad-2/+2
2018-11-10constify parts of libstd.Mazdak Farrokhzad-5/+5
2018-10-02make `CStr::from_bytes_with_nul_unchecked()` a const fnAustin Bonander-1/+11
closes #54678
2018-09-17OsStr: Document that it's not NUL terminatedColin Walters-1/+4
I somehow got confused into thinking this was the case, but it's definitely not. Let's help the common case of people who have an `OsStr` and need to call e.g. Unix APIs.
2018-09-14Move std::os::raw::c_void into libcore and re-export in libstdIsaac Woods-0/+3
2018-09-14Rollup merge of #54203 - cuviper:stable-os_str_str_ref_eq, r=estebankkennytm-2/+2
Fix the stable release of os_str_str_ref_eq This was added and stabilized in commit 02503029b83a, but while that claimed to be for 1.28.0, it didn't actually make it until 1.29.0. Fixes #54195.
2018-09-13Fix the stable release of os_str_str_ref_eqJosh Stone-2/+2
This was added and stabilized in commit 02503029b83a, but while that claimed to be for 1.28.0, it didn't actually make it until 1.29.0.
2018-09-14Rollup merge of #53976 - GuillaumeGomez:expect-world, r=steveklabnikkennytm-30/+34
Replace unwrap calls in example by expect Part of #51668. r? @steveklabnik
2018-09-08`&CStr`, not `CStr`, is the counterpart of `&str`Simonas Kazlauskas-2/+3
2018-09-06Fix linkGuillaume Gomez-3/+0
2018-09-05Replace unwrap calls in example by expectGuillaume Gomez-30/+34
2018-08-11Add links to std::char::REPLACEMENT_CHARACTER from docs.Corey Farwell-4/+7
There are a few places where we mention the replacement character in the docs, and it could be helpful for users to utilize the constant which is available in the standard library, so let’s link to it!
2018-08-01Rollup merge of #52340 - cypher:document-from-trait-in-ffi, r=steveklabnikPietro Albini-0/+48
Document From trait implementations for OsStr, OsString, CString, and CStr As part of issue #51430 (cc @skade). The allocation and copy claims should be double-checked. r? @steveklabnik