Commit Graph

831 Commits

Author SHA1 Message Date
Christopher Serr cf9d6672b7 Remove feature gates from std and tests 2019-04-26 12:33:42 +02:00
Mazdak Farrokhzad 3fffcd3314
Rollup merge of #60185 - NieDzejkob:int-error-kind-reexport, r=rkruppe
Reexport IntErrorKind in std

Currently `IntErrorKind` can only be found in `core`. @Centril confirmed on Discord that this is unintentional (should I r? him in this situation?).

Should there be a test for this? As far as this *specific* situation goes, I don't think so, I'll risk it and say that there's no way this regresses. However, it might be a good idea to have some tool detect public items in `core` that are not reexported in `std`. Does this belong in tidy, or should that be a separate tool? Is there some rustc-specific *linter*? Unless that's entirely a dumb idea, this should probably get an issue.

Note: My local build hasn't finished yet, but it's well past the point where I would expect problems.
2019-04-25 03:05:25 +02:00
Taylor Cramer 3f966dcd53 Stabilize futures_api 2019-04-23 16:13:53 -07:00
Jakub Kądziołka 7af0fccc88
Reexport IntErrorKind in std 2019-04-23 00:15:43 +02:00
Ralf Jung 8ef7ca1302 make lint levels more consistent 2019-04-14 10:16:23 +02:00
Simon Sapin fc928a18ba Stabilize the `alloc` crate.
This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

Closes https://github.com/rust-lang/rust/issues/27783
2019-04-12 20:07:30 +02:00
Mazdak Farrokhzad 379c380a60 libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
Aleksey Kladov 9d408d972f Add todo!() macro
The use-case of `todo!()` macro is to be a much easier to type
alternative to `unimplemented!()` macro.
2019-03-18 19:27:31 +03:00
kennytm 6241fb55ba
Rollup merge of #59152 - smmalis37:range_contains, r=SimonSapin
Stabilize Range*::contains.

Closes https://github.com/rust-lang/rust/issues/32311. There's also a bit of rustfmt on range.rs thrown in for good measure (I forgot to turn off format-on-save in VSCode).
2019-03-16 22:40:23 +08:00
bors 70d1150478 Auto merge of #58710 - EdorianDark:master, r=sfackler
Add clamp for ranges. Implements #44095

Ready for merge
2019-03-15 06:23:21 +00:00
Steven Malis 266ca31f74 Stabilize Range*::contains. 2019-03-12 21:00:37 -07:00
Dirk Leifeld 6041ec3b78 add feature clamp 2019-03-09 20:10:48 +01:00
Jethro Beekman c0e8cf9410 Use the correct stderr when testing libstd 2019-02-28 19:09:17 -08:00
Taiki Endo 90dbf59b92 Fix some imports and paths 2019-02-28 04:06:17 +09:00
Taiki Endo 2c783c3543 Revert removed #![feature(nll)] 2019-02-28 04:06:16 +09:00
Taiki Endo 93b6d9e086 libstd => 2018 2019-02-28 04:06:15 +09:00
bors f5b5f924eb Auto merge of #58709 - kornelski:book, r=QuietMisdreavus
Update book submodule

Updates the book to the latest commit

This is to include [documentation SEO fix](https://github.com/rust-lang/book/pull/1788) ASAP.
2019-02-27 07:53:56 +00:00
bors fb162e6944 Auto merge of #58357 - sfackler:vectored-io, r=alexcrichton
Add vectored read and write support

This functionality has lived for a while in the tokio ecosystem, where
it can improve performance by minimizing copies.

r? @alexcrichton
2019-02-26 02:48:13 +00:00
bors 00aae71f50 Auto merge of #58302 - SimonSapin:tryfrom, r=alexcrichton
Stabilize TryFrom and TryInto with a convert::Infallible empty enum

This is the plan proposed in https://github.com/rust-lang/rust/issues/33417#issuecomment-423073898
2019-02-25 20:24:10 +00:00
Kornel 19c302c89a Update book submodule 2019-02-25 13:30:51 +00:00
Aleksey Kladov 88d55f537d Make std feature list sorted
This helps to avoid merge conflicts when concurrent PRs append
features to the end of the list.
2019-02-22 11:04:10 +03:00
kennytm 17b07f99e8
Rollup merge of #58395 - vi:checked_duration_since, r=dtolnay
Instant::checked_duration_since
2019-02-17 14:52:23 +08:00
Steven Fackler 31bcec648a Add vectored read and write support
This functionality has lived for a while in the tokio ecosystem, where
it can improve performance by minimizing copies.
2019-02-13 19:40:17 -08:00
Mazdak Farrokhzad 919cf42feb
Rollup merge of #57992 - Matthias247:waker4, r=cramertj
Update the future/task API

This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592.

Changes:
- Replacing UnsafeWake with RawWaker and RawWakerVtable
- Removal of LocalWaker
- Removal of Arc-based Wake trait
2019-02-14 02:41:17 +01:00
Simon Sapin c80a8f51dc Stabilize TryFrom and TryInto 2019-02-13 18:00:18 +01:00
bors ccd23b95e5 Auto merge of #58235 - jethrogb:jb/sgx-usercall-internals, r=alexcrichton
SGX target: simplify usercall internals

This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers.

cc @VardhanThigle

r? @alexcrichton
2019-02-13 07:46:21 +00:00
Matthias Einwag 871338c3ae Merging master 2019-02-12 22:46:14 -08:00
Vitaly _Vi Shukela 7b2a08cf49
Add Instant::checked_duration_since, address #58402. 2019-02-13 00:49:48 +03:00
Alexander Regueiro 99ed06eb88 libs: doc comments 2019-02-10 23:57:25 +00:00
Guillaume Gomez 8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00
Jethro Beekman 0d2ab0b77d SGX target: simplify usercall internals
This moves logic from assembly to Rust and removes the special
case for exit/panic handling, merging it with regular usercall
handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00.
The bug would make regular exits look like panics with high
probability. It would also with some probability leak information
through uncleared registers.
2019-02-06 23:24:55 +05:30
Matthias Einwag d9a4b22d32 Update the future/task API
This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592.

Changes:
- Replacing UnsafeWake with RawWaker and RawWakerVtable
- Removal of LocalWaker
- Removal of Arc-based Wake trait
2019-02-03 13:46:53 -08:00
gnzlbg 938a814e87 Update stdsimd 2019-01-29 10:48:54 +01:00
Mark Rousskov b7f030e114 Bump bootstrap compiler to 1.33 beta 2019-01-26 08:02:08 -07:00
Mazdak Farrokhzad e7b584cee1
Rollup merge of #57179 - Xaeroxe:patch-1, r=QuietMisdreavus
Update std/lib.rs docs to reflect Rust 2018 usage

Fixes #56544

This paragraph was written for Rust 2015.  Since 2018 has been stable for a while I think we can update it.
2019-01-24 00:19:50 +01:00
Jacob Kiesel 4781c6f8e7
Remove unused links 2019-01-22 09:39:19 -07:00
Clar Fon 24ca530526 Move spin_loop_hint to core::hint module 2019-01-15 16:44:28 -05:00
Jethro Beekman 972bba7071 Stabilize `cfg_target_vendor`, #29718 2019-01-14 14:33:04 +05:30
Mazdak Farrokhzad 85a7fc8c48
Rollup merge of #57441 - 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-12 10:55:07 +01:00
bors 0c91f3d97f Auto merge of #57234 - Centril:const-stabilizations-2, r=oli-obk
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-12 02:00:18 +00:00
Vardhan Thigle 4166a4e5d0 Supporting backtrace for x86_64-fortanix-unknown-sgx. 2019-01-08 22:10:55 +05:30
Pietro Albini bc38143ad2
Rollup merge of #57375 - stjepang:duration-constants, r=joshtriplett
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-07 16:25:40 +01:00
Stjepan Glavina 72ec5aa080 Re-export constants from core into std 2019-01-06 14:04:07 +01:00
Yu Ding a3128116d2 Remove min_const_unsafe_fn since it is stable
Signed-off-by: Yu Ding <dingelish@gmail.com>
2019-01-01 11:49:54 -08:00
Yu Ding d04f5208ba Bound sgx target_env with fortanix as target_vendor
Signed-off-by: Yu Ding <dingelish@gmail.com>
2018-12-31 16:32:56 -08:00
Mazdak Farrokhzad 14be8a7f14 const-stabilize Ipv4Addr::new 2018-12-31 16:36:39 +01:00
Mazdak Farrokhzad 2760f87e3a const-stabilize const_int_ops + reverse_bits 2018-12-31 16:11:03 +01:00
Jacob Kiesel eed140792d
Update std/lib.rs docs to reflect Rust 2018 usage 2018-12-28 14:15:55 -07:00
varkor 04c1a92fa0 Fix warning when compiling rustc 2018-12-28 19:28:57 +00:00
bors d2986970ad Auto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplett
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-27 09:21:06 +00:00