about summary refs log tree commit diff
path: root/src/libstd/lib.rs
AgeCommit message (Collapse)AuthorLines
2019-01-12Rollup merge of #57441 - ↵Mazdak Farrokhzad-1/+1
VardhanThigle:Vardhan/x86_64-fortanix-unknown-sgx-backtrace-support, r=alexcrichton Supporting backtrace for x86_64-fortanix-unknown-sgx. # Overview Implementing following functions required by `libstd/sys_common` to support `backtrace`: ``` 1. unwind_backtrace 2. trace_fn 3. resolve_symname ``` # Description: The changes here are quite similar to the Cloudabi target `src/libstd/sys/cloudabi/backtrace.rs` The first 2 functions are implemented via calls to libunwind.a that is linked to the `x86_64-fortanix-unknown-sgx` (#56979), we have not implemented functionality needed by `resolve_symname` (or `dladdr`) to reduce SGX TCB. Rather, we print the function address (relative to enclave image base) in `resolve_symname` which can be later translated to correct symbol name (say, via `addr2line`). # Note: For `x86_64-fortanix-unknown-sgx`, the `RUST_BACKTRACE` environment has to be set from within the program running in an enclave. cc: @jethrogb r? @alexcrichton
2019-01-12Auto merge of #57234 - Centril:const-stabilizations-2, r=oli-obkbors-2/+2
Const-stabilize `const_int_ops` + `const_ip` r? @oli-obk ## Note for relnotes: This PR includes https://github.com/rust-lang/rust/pull/57105. I've added T-lang since this affects intrinsics and the operational semantics of Rust's `const fn` fragment. ## Stable APIs proposed for constification + `const_int_ops`: + `count_ones` + `count_zeros` + `leading_zeros` + `trailing_zeros` + `swap_bytes` + `from_be` + `from_le` + `to_be` + `to_le` + `const_ip` + `Ipv4Addr::new` ## Unstable APIs constified + `const_int_conversion`: + `reverse_bits`
2019-01-08Supporting backtrace for x86_64-fortanix-unknown-sgx.Vardhan Thigle-1/+1
2019-01-07Rollup merge of #57375 - stjepang:duration-constants, r=joshtriplettPietro Albini-0/+1
Add duration constants Add constants `SECOND`, `MILLISECOND`, `MICROSECOND`, and `NANOSECOND` to `core::time`. This will make working with durations more ergonomic. Compare: ```rust // Convenient, but deprecated function. thread::sleep_ms(2000); // The current canonical way to sleep for two seconds. thread::sleep(Duration::from_secs(2)); // Sleeping using one of the new constants. thread::sleep(2 * SECOND); ```
2019-01-06Re-export constants from core into stdStjepan Glavina-0/+1
2019-01-01Remove min_const_unsafe_fn since it is stableYu Ding-2/+1
Signed-off-by: Yu Ding <dingelish@gmail.com>
2018-12-31Bound sgx target_env with fortanix as target_vendorYu Ding-4/+5
Signed-off-by: Yu Ding <dingelish@gmail.com>
2018-12-31const-stabilize Ipv4Addr::newMazdak Farrokhzad-1/+1
2018-12-31const-stabilize const_int_ops + reverse_bitsMazdak Farrokhzad-1/+1
2018-12-28Fix warning when compiling rustcvarkor-1/+0
2018-12-27Auto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplettbors-1/+2
Add `io` and `arch` modules to `std::os::fortanix_sgx` This PR adds two more (unstable) modules to `std::os::fortanix_sgx` for the `x86_64-fortanix-unknown-sgx` target. ### io `io` allows conversion between raw file descriptors and Rust types, similar to `std::os::unix::io`. ### arch `arch` exposes the `ENCLU[EREPORT]` and `ENCLU[EGETKEY]` instructions. The current functions are very likely not going to be the final form of these functions (see also https://github.com/fortanix/rust-sgx/issues/15), but this should be sufficient to enable experimentation in libraries. I tried using the actual types (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)) instead of byte arrays, but that would make `std` dependent on the `bitflags` crate which I didn't want to do at this time.
2018-12-26Stabilize duration_as_u128Sunjay Varma-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-25Fix build on latest git masterJethro Beekman-1/+2
2018-12-24std: Use backtrace-sys from crates.ioAlex Crichton-0/+3
This commit switches the standard library to using the `backtrace-sys` crate from crates.io instead of duplicating the logic here in the Rust repositor with the `backtrace-sys`'s crate's logic. Eventually this will hopefully be a good step towards using the `backtrace` crate directly from crates.io itself, but we're not quite there yet! Hopefully this is a small incremental first step we can take.
2018-12-24Rollup merge of #56978 - jethrogb:jb/sgx-os-mod, r=joshtriplettMazdak Farrokhzad-1/+1
Add `std::os::fortanix_sgx` module This PR adds the `std::os::sgx` module to expose platform-specific APIs behind the `sgx_platform` feature gate. Depends on https://github.com/rust-lang/rust/pull/56972 to be able to meaningfully build `std::os` documentation for non-standard targets. Tracking issue: https://github.com/rust-lang/rust/issues/56975
2018-12-23Rollup merge of #57067 - Centril:stabilize-min_const_unsafe_fn, r=oli-obkMazdak Farrokhzad-1/+0
Stabilize min_const_unsafe_fn in 1.33 Fixes #55607 r? @oli-obk
2018-12-23Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichtonMazdak Farrokhzad-2/+1
Pin stabilization This implements the changes suggested in https://github.com/rust-lang/rust/issues/55766#issue-378417538 and stabilizes the `pin` feature. @alexcrichton also listed several "blockers" in that issue, but then in [this comment](https://github.com/rust-lang/rust/issues/55766#issuecomment-445074980) mentioned that they're more "TODO items": > In that vein I think it's fine for a stabilization PR to be posted at any time now with FCP lapsed for a week or so now. The final points about self/pin/pinned can be briefly discussed there (if even necessary, they could be left as the proposal above). Let's settle these last bits here and get this thing stabilized! :) r? @alexcrichton cc @withoutboats
2018-12-23stabilize min_const_unsafe_fn in 1.33.Mazdak Farrokhzad-1/+0
2018-12-23Rollup merge of #56941 - euclio:deny-libstd-resolution-failures, ↵kennytm-0/+1
r=QuietMisdreavus deny intra-doc link resolution failures in libstd Fixes #56693. Until we land a fix for the underlying issue (#56922), we can at least fix the failures in libstd so they don't propagate to downstream crates.
2018-12-21Stabilize PinTaylor Cramer-2/+1
2018-12-20Fix pipe2 and accept4 on static linked executables on linux (like musl).Adrian Budau-0/+1
2018-12-20Add `std::os::fortanix_sgx` moduleJethro Beekman-1/+1
2018-12-17deny intra-doc link resolution failures in libstdAndy Russell-0/+1
2018-12-14std: Use `rustc_demangle` from crates.ioAlex Crichton-0/+1
No more need to duplicate the demangling routine between crates.io and the standard library, we can use the exact same one!
2018-12-14Rollup merge of #56708 - oli-obk:stability_internal_const_fn, r=alexcrichtonkennytm-0/+1
Remove some unnecessary feature gates fixes #56585 cc @jethrogb
2018-12-12Bump to 1.33.0Alex Crichton-4/+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-11Properly stage new feature gatesOliver Scherer-1/+1
2018-12-11Remove unnecessary feature gates from const fnsOliver Scherer-0/+1
2018-12-10Update Cargo submodule and its dependenciesAlex Crichton-4/+3
Hopefully just another routine update! So far this starts to enable the `std::arch` in stage0 builds of rustc. This means that we may need stage0/not(stage0) in stdsimd itself, but more and more code is starting to use `std::arch` so I think it's time to start shifting the balance of work here.
2018-12-07SGX target: implement user memory managementJethro Beekman-1/+2
2018-12-07Add x86_64-fortanix-unknown-sgx target to libstd and dependenciesJethro Beekman-0/+7
The files src/libstd/sys/sgx/*.rs are mostly copied/adapted from the wasm target. This also updates the dlmalloc submodule to the very latest version.
2018-12-02Auto merge of #56275 - RalfJung:win-mutex, r=SimonSapinbors-0/+1
use MaybeUninit instead of mem::uninitialized for Windows Mutex I hope this builds, I do not have a Windows machine to test...
2018-11-27add missing featureRalf Jung-0/+1
2018-11-26libcore: Add va_list lang item and intrinsicsDan Robertson-0/+1
- 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-21update various stdlib docsSteve Klabnik-2/+2
2018-11-20fix more linksSteve Klabnik-5/+5
2018-11-11std: Delete the `alloc_system` crateAlex Crichton-3/+1
This commit deletes the `alloc_system` crate from the standard distribution. This unstable crate is no longer needed in the modern stable global allocator world, but rather its functionality is folded directly into the standard library. The standard library was already the only stable location to access this crate, and as a result this should not affect any stable code.
2018-11-10Fix documentation typos.Bruce Mitchener-1/+1
2018-11-08Auto merge of #55366 - Amanieu:stable_layout, r=Amanieubors-0/+1
Add tracking issue for Layout methods (and some API changes) These methods are already useful when used with the stable global allocator API (stabilized in #51241). ```rust pub fn align_to(&self, align: usize) -> Result<Layout, LayoutErr>; pub fn padding_needed_for(&self, align: usize) -> usize; pub fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutErr>; pub fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutErr>; pub fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutErr>; pub fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutErr>; pub fn array<T>(n: usize) -> Result<Layout, LayoutErr>; ``` cc #32838 r? @SimonSapin
2018-11-06Add a tracking issue for extra Layout methodsAmanieu d'Antras-0/+1
2018-11-02Remove all jemalloc-related contentAlex Crichton-8/+1
This commit removes all jemalloc related submodules, configuration, etc, from the bootstrap, from the standard library, and from the compiler. This will be followed up with a change to use jemalloc specifically as part of rustc on blessed platforms.
2018-11-02Auto merge of #54043 - fintelia:raw_entry, r=alexcrichtonbors-0/+1
Add raw_entry API to HashMap This is a continuation of #50821.
2018-10-31Bump nightly to 1.32.0Alex Crichton-1/+0
* Also update the bootstrap compiler * Update cargo to 1.32.0 * Clean out stage0 annotations
2018-10-05Stabilize `min_const_fn`Oliver Schneider-1/+1
2018-10-05Auto merge of #54017 - alexcrichton:wasm-atomics2, r=sfacklerbors-0/+1
std: Start implementing wasm32 atomics This commit is an initial start at implementing the standard library for wasm32-unknown-unknown with the experimental `atomics` feature enabled. None of these changes will be visible to users of the wasm32-unknown-unknown target because they all require recompiling the standard library. The hope with this is that we can get this support into the standard library and start iterating on it in-tree to enable experimentation. Currently there's a few components in this PR: * Atomic fences are disabled on wasm as there's no corresponding atomic op and it's not clear yet what the convention should be, but this will change in the future! * Implementations of `Mutex`, `Condvar`, and `RwLock` were all added based on the atomic intrinsics that wasm has. * The `ReentrantMutex` and thread-local-storage implementations panic currently as there's no great way to get a handle on the current thread's "id" yet. Right now the wasm32 target with atomics is unfortunately pretty unusable, requiring a lot of manual things here and there to actually get it operational. This will likely continue to evolve as the story for atomics and wasm unfolds, but we also need more LLVM support for some operations like custom `global` directives for this to work best.
2018-10-02make `CStr::from_bytes_with_nul_unchecked()` a const fnAustin Bonander-0/+1
closes #54678
2018-10-02make `CStr::from_bytes_with_nul_unchecked()` a const fnAustin Bonander-0/+1
closes #54678
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-8/+3
2018-09-24std: Start implementing wasm32 atomicsAlex Crichton-0/+1
This commit is an initial start at implementing the standard library for wasm32-unknown-unknown with the experimental `atomics` feature enabled. None of these changes will be visible to users of the wasm32-unknown-unknown target because they all require recompiling the standard library. The hope with this is that we can get this support into the standard library and start iterating on it in-tree to enable experimentation. Currently there's a few components in this PR: * Atomic fences are disabled on wasm as there's no corresponding atomic op and it's not clear yet what the convention should be, but this will change in the future! * Implementations of `Mutex`, `Condvar`, and `RwLock` were all added based on the atomic intrinsics that wasm has. * The `ReentrantMutex` and thread-local-storage implementations panic currently as there's no great way to get a handle on the current thread's "id" yet. Right now the wasm32 target with atomics is unfortunately pretty unusable, requiring a lot of manual things here and there to actually get it operational. This will likely continue to evolve as the story for atomics and wasm unfolds, but we also need more LLVM support for some operations like custom `global` directives for this to work best.