about summary refs log tree commit diff
path: root/src/libstd/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-04-16Stabilize core::hint::unreachable_unchecked.kennytm-0/+2
Closes #43751.
2018-04-13std: Minimize size of panicking on wasmAlex Crichton-0/+1
This commit applies a few code size optimizations for the wasm target to the standard library, namely around panics. We notably know that in most configurations it's impossible for us to print anything in wasm32-unknown-unknown so we can skip larger portions of panicking that are otherwise simply informative. This allows us to get quite a nice size reduction. Finally we can also tweak where the allocation happens for the `Box<Any>` that we panic with. By only allocating once unwinding starts we can reduce the size of a panicking wasm module from 44k to 350 bytes.
2018-04-12Use NonNull<Void> instead of *mut u8 in the Alloc traitMike Hommey-0/+1
Fixes #49608
2018-04-12Actually deprecate heap modules.Simon Sapin-1/+4
2018-04-12Rename `heap` modules in the core, alloc, and std crates to `alloc`Simon Sapin-1/+5
2018-04-12Import the `alloc` crate as `alloc_crate` in stdSimon Sapin-9/+9
… to make the name `alloc` available.
2018-04-12Mark the rest of the `unicode` feature flag as perma-unstable.Simon Sapin-1/+0
2018-04-12Reexport from core::unicode::char in core::char rather than vice versaSimon Sapin-1/+1
2018-04-12Deprecate the std_unicode crateSimon Sapin-2/+1
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-4/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-07Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakisbors-4/+0
Bump the bootstrap compiler to 1.26.0 beta Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-07Inject the `compiler_builtins` crate whenever the `core` crate is injectedOliver Schneider-0/+1
2018-04-05Rollup merge of #49686 - memoryleak47:typo, r=alexcrichtonAlex Crichton-1/+1
typos
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-4/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-05typosmemoryleak47-1/+1
2018-04-05Stabilize attributes on generic parametersVadim Petrochenkov-1/+1
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-1/+0
Closes #22181, #27779
2018-03-28Rollup merge of #49400 - Diggsey:shrink-to, r=joshtriplettkennytm-0/+1
Implement `shrink_to` method on collections Fixes #49385
2018-03-27Implement `shrink_to` method on collectionsDiggory Blake-0/+1
2018-03-26Stabilize the TryFrom and TryInto traitsSimon Sapin-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/33417
2018-03-26Stabilize i128 feature tooMark Mansi-4/+3
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-25Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakiskennytm-1/+1
Stabilize termination_trait, split out termination_trait_test For #48453. First time contribution, so I'd really appreciate any feedback on how this PR can be better. Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-23Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAusAlex Crichton-0/+1
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: https://github.com/rust-lang/rfcs/pull/2307 Tracking issue: ~~https://github.com/rust-lang/rust/issues/27730~~ https://github.com/rust-lang/rust/issues/49137 Fixes https://github.com/rust-lang/rust/issues/27730
2018-03-19Stabilize termination_traitTyler Mandry-1/+1
This stabilizes `main` with non-() return types; see #48453.
2018-03-17Add 12 num::NonZero* types for each primitive integerSimon Sapin-0/+1
RFC: https://github.com/rust-lang/rfcs/pull/2307
2018-03-17Mark deprecated unstable SipHasher13 as a doc-hidden impl detail of HashMap.Simon Sapin-2/+1
It stays in libcore rather than being private in HashMap’s module because it shares code with the deprecated *stable* `SipHasher` type.
2018-03-16Auto merge of #48813 - sinkuu:build_in_assert_macro, r=alexcrichtonbors-1/+2
Make `assert` a built-in procedural macro Makes `assert` macro a built-in one without touching its functionality. This is a prerequisite for RFC 2011 (#44838).
2018-03-15Auto merge of #47813 - kennytm:stable-incl-range, r=nrcbors-1/+0
Stabilize inclusive range (`..=`) Stabilize the followings: * `inclusive_range` — The `std::ops::RangeInclusive` and `std::ops::RangeInclusiveTo` types, except its fields (tracked by #49022 separately). * `inclusive_range_syntax` — The `a..=b` and `..=b` expression syntax * `dotdoteq_in_patterns` — Using `a..=b` in a pattern cc #28237 r? @rust-lang/lang
2018-03-15Stabilize `inclusive_range` library feature.kennytm-1/+0
Stabilize std::ops::RangeInclusive and std::ops::RangeInclusiveTo.
2018-03-15Auto merge of #48648 - snf:fallible_allocation, r=Kimundibors-0/+1
Fallible allocation Implementing RFC#2116 [Fallible Allocation](https://github.com/rust-lang/rust/issues/48043) . Work in progress. Initially adding @Gankro's try_reserve for Vec.
2018-03-14implementing fallible allocation API (try_reserve) for Vec, String and HashMapsnf-0/+1
2018-03-14stabilise feature(never_type)Andrew Cann-1/+2
Replace feature(never_type) with feature(exhaustive_patterns). feature(exhaustive_patterns) only covers the pattern-exhaustives checks that used to be covered by feature(never_type)
2018-03-07Make `assert` macro a built-in procedural macroShotaro Yamada-1/+2
2018-03-06Rollup merge of #47463 - bluss:fused-iterator, r=alexcrichtonkennytm-1/+0
Stabilize FusedIterator FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate. Closes #35602
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-1/+0
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-03-02std: Add `arch` and `simd` modulesAlex Crichton-0/+30
This commit imports the `stdsimd` crate into the standard library, creating an `arch` and `simd` module inside of both libcore and libstd. Both of these modules are **unstable** and will continue to be so until RFC 2335 is stabilized. As a brief recap, the modules are organized as so: * `arch` contains all current architectures with intrinsics, for example `std::arch::x86`, `std::arch::x86_64`, `std::arch::arm`, etc. These modules contain all of the intrinsics defined for the platform, like `_mm_set1_epi8`. * In the standard library, the `arch` module also exports a `is_target_feature_detected` macro which performs runtime detection to determine whether a target feature is available at runtime. * The `simd` module contains experimental versions of strongly-typed lane-aware SIMD primitives, to be fully fleshed out in a future RFC. The main purpose of this commit is to start pulling in all these intrinsics and such into the standard library on nightly and allow testing and such. This'll help allow users to easily kick the tires and see if intrinsics work as well as allow us to test out all the infrastructure for moving the intrinsics into the standard library.
2018-02-24Rollup merge of #48143 - nikomatsakis:termination_trait_in_tests, r=eddybManish Goregaokar-5/+0
Termination trait in tests Support the `Termination` trait in unit tests (cc https://github.com/rust-lang/rust/issues/43301) Also, a drive-by fix for #47075. This is joint work with @bkchr.
2018-02-22move Termination trait to std::processNiko Matsakis-4/+0
2018-02-22put the "unit test" logic into libtestNiko Matsakis-3/+2
Also make `std::termination` module public and rename feature. The lib feature needs a different name from the language feature.
2018-02-20stage0 cfg cleanupMark Simulacrum-1/+0
2018-02-18Auto merge of #47687 - SimonSapin:panic-impl, r=sfacklerbors-0/+1
RFC 2070 part 1: PanicInfo and Location API changes This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html Tracking issue: https://github.com/rust-lang/rust/issues/44489 * Move `std::panic::PanicInfo` and `std::panic::Location` to a new `core::panic` module. The two types and the `std` module were already `#[stable]` and stay that way, the new `core` module is `#[unstable]`. * Add a new `PanicInfo::message(&self) -> Option<&fmt::Arguments>` method, which is `#[unstable]`. * Implement `Display` for `PanicInfo` and `Location`
2018-01-29Document std::os::raw.Clar Charr-0/+1
2018-01-23Move PanicInfo and Location to libcoreSimon Sapin-0/+1
Per https://rust-lang.github.io/rfcs/2070-panic-implementation.html
2018-01-23Stabilized `#[repr(align(x))]` attribute (RFC 1358)Cameron Hart-1/+1
2018-01-20Stabilize std::ptr::NonNullSimon Sapin-1/+0
2018-01-20Mark Unique as perma-unstable, with the feature renamed to ptr_internals.Simon Sapin-1/+1
2018-01-20Rename std::ptr::Shared to NonNullSimon Sapin-1/+1
`Shared` is now a deprecated `type` alias. CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-3/+3
2018-01-13Auto merge of #46461 - zackmdavis:elemental_method_suggestion_jamboree, ↵bors-1/+1
r=estebank type error method suggestions use whitelisted identity-like conversions ![method_jamboree_summit](https://user-images.githubusercontent.com/1076988/33523646-e5c43184-d7c0-11e7-98e5-1bff426ade86.png) Previously, on a type mismatch (and if this wasn't preëmpted by a higher-priority suggestion), we would look for argumentless methods returning the expected type, and list them in a `help` note. This had two major shortcomings: firstly, a lot of the suggestions didn't really make sense (if you used a &str where a String was expected, `.to_ascii_uppercase()` is probably not the solution you were hoping for). Secondly, we weren't generating suggestions from the most useful traits! We address the first problem with an internal `#[rustc_conversion_suggestion]` attribute meant to mark methods that keep the "same value" in the relevant sense, just converting the type. We address the second problem by making `FnCtxt.probe_for_return_type` pass the `ProbeScope::AllTraits` to `probe_op`: this would seem to be safe because grep reveals no other callers of `probe_for_return_type`. Also, structured suggestions are pretty and good for RLS and friends. Unfortunately, the trait probing is still not all one would hope for: at a minimum, we don't know how to rule out `into()` in cases where it wouldn't actually work, and we don't know how to rule in `.to_owned()` where it would. Issues #46459 and #46460 have been filed and are ref'd in a FIXME. This is hoped to resolve #42929, #44672, and #45777.