345 Commits

Author SHA1 Message Date
Ross MacArthur
f7256d28d1
Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
Mark Mansi
7d268119f0 no need to bootstrap 2019-12-18 20:19:05 -06:00
Mark Mansi
3ec3fca414 remove a bit more hackery 2019-12-18 20:19:05 -06:00
Mark Rousskov
82184440ec Propagate cfg bootstrap 2019-12-18 12:16:19 -05:00
Oliver Scherer
d75c7530f3 Reuse the staged_api feature for rustc_const_unstable 2019-12-13 11:27:01 +01:00
Mazdak Farrokhzad
1c7595fd0f gate rustc_on_unimplemented under rustc_attrs 2019-11-06 07:34:51 +01:00
Clar Fon
eeb549bfc3 Add Cow::is_borrowed and Cow::is_owned 2019-10-22 19:56:41 -04:00
Mazdak Farrokhzad
7c20a8ddb8
Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton
Split non-CAS atomic support off into target_has_atomic_load_store

This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s:

* `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations).
* ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS).

cc #32976

r? @alexcrichton
2019-10-13 19:17:04 +02:00
Jon Gjengset
45aca119a6
Stabilize mem::take (mem_take)
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08 18:04:18 -04:00
Amanieu d'Antras
dfe76a1093 Split non-CAS atomic support off into target_has_atomic_load_store 2019-10-08 20:34:30 +01:00
Mark Rousskov
f359a94849 Snap cfgs to new beta 2019-09-25 08:42:46 -04:00
Mazdak Farrokhzad
d5fe5831ec Const-stabilize Vec::new. 2019-09-16 16:45:16 +02:00
Vadim Petrochenkov
d42e60331f Improve hygiene of alloc::format! 2019-09-07 22:40:57 +03:00
Simon Sapin
59a340963f Add the Layout of the failed allocation to TryReserveError::AllocError
… and add a separately-unstable field to force non-exhaustive matching
(`#[non_exhaustive]` is no implemented yet on enum variants)
so that we have the option to later expose the allocator’s error value.

CC https://github.com/rust-lang/wg-allocators/issues/23
2019-08-16 18:08:37 +02:00
Mark Rousskov
2601c86487 Handle cfg(bootstrap) throughout 2019-08-14 05:39:53 -04:00
Ilija Tovilo
3a6a29b4ec
Use associated_type_bounds where applicable - closes #61738 2019-08-08 22:39:15 +02:00
Jake Goulding
32324d22c3 Add implementations for converting boxed slices into boxed arrays
This mirrors the implementations of reference slices into arrays.
2019-08-05 10:26:53 -04:00
Mazdak Farrokhzad
dbf54ad324
Rollup merge of #63095 - Centril:incomplete-features-lint, r=varkor
Turn `INCOMPLETE_FEATURES` into lint

We do this because it is annoying to see the warning when building rustc and because this is better from a "separation of concerns" POV.

The drawback to this change is that this will respect `--cap-lints`.
Also note that this is not a buffered lint so if there are fatal parser errors then the lint will not trigger.

r? @varkor
2019-07-30 22:43:34 +02:00
Mazdak Farrokhzad
9fb8f1b2bf
Rollup merge of #62469 - czipperz:liballoc-add-doc-links, r=GuillaumeGomez
Add doc links to liballoc crate page
2019-07-30 22:43:33 +02:00
Mazdak Farrokhzad
8a90173239 Allow 'incomplete_features' in libcore/alloc. 2019-07-30 10:32:43 +02:00
Vadim Petrochenkov
434152157f Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
2019-07-28 18:46:24 +03:00
Mazdak Farrokhzad
8b57f689d5 Use const generics for some Vec/CCow impls. 2019-07-28 06:33:54 +02:00
Ralf Jung
4b47e78a16 use a const to hack around promotion limitations 2019-07-21 12:28:18 +02:00
Ralf Jung
e074db764a use const array repeat expressions for uninit_array 2019-07-19 14:47:56 +02:00
bors
4a95e9704d Auto merge of #61953 - Centril:shared-from-iter, r=RalfJung
Add `impl<T> FromIterator<T> for Arc/Rc<[T]>`

Add implementations of `FromIterator<T> for Arc/Rc<[T]>` with symmetrical logic.

This also takes advantage of specialization in the case of iterators with known length (`TrustedLen`) to elide the final allocation/copying from a `Vec<T>` into `Rc<[T]>` because we can allocate the space for the `Rc<[T]>` directly when the size is known. This is the primary motivation and why this is to be preferred over `iter.collect::<Vec<_>>().into(): Rc<[T]>`.

Moreover, this PR does some refactoring in some places.

r? @RalfJung for the code
cc @alexcrichton from T-libs
2019-07-13 06:49:02 +00:00
Chris Gregory
2534b287a6 Add doc links to liballoc crate page 2019-07-07 08:31:50 -07:00
Mark Rousskov
8a7dded1a2 Switch master to 1.38 2019-07-04 11:26:57 -04:00
Chris Gregory
b0c199a969 Enable mem_take feature in relevant crates 2019-07-01 20:21:53 -07:00
Mazdak Farrokhzad
4b44ad9038 deduplicate slice_from_raw_parts_mut. 2019-06-20 09:28:13 +02:00
Mazdak Farrokhzad
353c8eb828 shared_from_iter/Rc: Use specialization to elide allocation. 2019-06-20 09:28:12 +02:00
chansuke
89292beedb Separate liballoc module 2019-06-16 13:08:09 +03:00
Vadim Petrochenkov
74a6d1c821 Turn #[allocator] into a built-in attribute and rename it to #[rustc_allocator] 2019-06-08 23:55:25 +03:00
Lzu Tao
0c35c699d4 Stabilize iter_nth_back feature 2019-05-30 18:00:17 +00:00
Ralf Jung
b7afe777f7 stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the future
Also expand the documentation a bit
2019-05-20 10:44:02 +02:00
Mazdak Farrokhzad
639e452c5f Remove unused feature(need_allocator). 2019-05-04 04:20:55 +02:00
Taylor Cramer
3f966dcd53 Stabilize futures_api 2019-04-23 16:13:53 -07:00
Ralf Jung
50c615baa2 warn(missing_docs) in liballoc, and add missing docs 2019-04-15 16:35:50 +02:00
Ralf Jung
8ef7ca1302 make lint levels more consistent 2019-04-14 10:16:23 +02:00
Ralf Jung
cdf1d368e2 bump stdsimd; make intra_doc_link_resolution_failure an error again 2019-04-14 10:00:22 +02:00
Mazdak Farrokhzad
bdb264ff5f
Rollup merge of #59675 - SimonSapin:stable-alloc, r=alexcrichton
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-14 00:23:25 +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
Masaki Hara
059ec76d9b Add Fn* blanket impls for Box. 2019-04-05 02:26:51 +08:00
kennytm
cb2dde63d5
Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcm
Implement specialized nth_back() for Box and Windows.

Hi there, this is my first pull request to rust :-)

I started implementing some specializations for DoubleEndedIterator::nth_back() and these are the first two. The problem has been discussed in #54054 and nth_back() is tracked in #56995.

I'm stuck with the next implementation so I though I do a PR for the ones I'm confident with to get some feedback.
2019-03-24 19:00:10 +08:00
Adrian Friedli
4837fb45ff
implement nth_back for Box 2019-02-16 22:34:28 +01:00
kennytm
9a2437c0dc
Rollup merge of #58468 - RalfJung:maybe-uninit-split, r=Centril
split MaybeUninit into several features, expand docs a bit

This splits the `maybe_uninit` feature gate into several:

* `maybe_uninit` for what we will hopefully stabilize soon-ish.
* `maybe_uninit_ref` for creating references into `MaybeUninit`, for which the rules are not yet clear.
* `maybe_uninit_slice` for handling slices of `MaybeUninit`, which needs more API design work.
* `maybe_uninit_array` for creating arrays of `MaybeUninit` using a macro (because we don't have https://github.com/rust-lang/rust/issues/49147 yet).

Is that an okay thing to do? The goal is to help people avoid APIs we do not want to stabilize yet. I used this to make sure rustc itself does not use `get_ref` and `get_mut`.

I also extended the docs to advise against uninitialized integers -- again this is something for which the rules are still being discussed.
2019-02-16 14:11:55 +08:00
Ralf Jung
95ef9b4fc2 make Centril happy 2019-02-14 22:31:06 +01:00
Ralf Jung
b5ab2c7f1c split MaybeUninit into several features, expand docs a bit 2019-02-14 20:07:57 +01:00
Matthias Einwag
871338c3ae Merging master 2019-02-12 22:46:14 -08:00
Simon Sapin
7a077804a3 New return types for str::escape_* that impl Display and Iterator<char>
As FCP’ed in the tracking issue: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 09:55:20 +01:00
Guillaume Gomez
8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00