about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-11-30Remove a bunch of now-unnecessary `const_let` feature gatesOliver Scherer-1/+1
2018-11-30Fix exceeding line width limitVitaly _Vi Shukela-1/+2
2018-11-30panic_immediate_abort: Fix issues from reviewVitaly _Vi Shukela-7/+6
2018-11-30Add libstd and libcore Cargo features "panic_immediate_abort"Vitaly _Vi Shukela-3/+25
It stop asserts and panics from libstd to automatically include string output and formatting code. Use case: developing static executables smaller than 50 kilobytes, where usual formatting code is excessive while keeping debuggability in debug mode. May resolve #54981.
2018-11-29Add inline attributes and add unit to CommonTypesJohn Kåre Alsaker-0/+1
2018-11-29Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddybbors-0/+185
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-29Rollup merge of #56273 - GuillaumeGomez:iterator-fnmut-missing-link, ↵Guillaume Gomez-1/+2
r=steveklabnik Add missing doc link r? @steveklabnik
2018-11-29Rollup merge of #56236 - frewsxcv:frewsxcv-unsafe-unsafe, r=cramertjGuillaume Gomez-5/+2
Remove unsafe `unsafe` inner function. Within this `Iterator` implementation, a function `unsafe_get` is defined which unsafely allows _unchecked_ indexing of any element in a slice. This should be marked as _unsafe_, but it is not. To address this issue, I removed that inner function.
2018-11-29Rollup merge of #56023 - vorner:doc/atomic-ordering-strip, r=@stjepangGuillaume Gomez-7/+9
atomic::Ordering: Get rid of misleading parts of intro Remove the parts of atomic::Ordering's intro that wrongly claimed that SeqCst prevents all reorderings around it. Closes #55196 This is a (minimal) alternative to #55233. I also wonder if it would be worth adding at least some warnings that atomics are often a footgun/hard to use correctly, similarly like `mem::transmute` or other functions have.
2018-11-28put the MaybeUninit inside the UnsafeCellRalf Jung-3/+0
2018-11-27Move feature enable in ptr::hash doc exampleDale Wijnand-1/+1
2018-11-27Try to fix ptr::hash's doc exampleDale Wijnand-2/+3
2018-11-27remove uses of feature gateMark Mansi-1/+0
2018-11-27Fix issue numberDale Wijnand-1/+1
2018-11-27Add an assert_eq in ptr::hash's doc exampleDale Wijnand-1/+7
2018-11-27Pick a better variable name for ptr::hashDale Wijnand-2/+2
2018-11-27Fix stability attribute for ptr::hashDale Wijnand-1/+1
2018-11-27add comments explaining our uses of get_ref/get_mut for MaybeUninitRalf Jung-0/+9
2018-11-27Add missing doc linkGuillaume Gomez-1/+2
2018-11-26libcore: Add va_list lang item and intrinsicsDan Robertson-0/+185
- 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-26Auto merge of #54668 - RalfJung:use-maybe-uninit, r=SimonSapinbors-52/+53
Use MaybeUninit in libcore All code by @japaric. This re-submits the second half of https://github.com/rust-lang/rust/pull/53508 (the first half is at https://github.com/rust-lang/rust/pull/54667). This is likely the one containing the perf regression.
2018-11-26Fix ptr::hex doc exampleDale Wijnand-1/+1
2018-11-26FIXME is the new TODODale Wijnand-1/+1
2018-11-26Introduce ptr::hash for referencesDale Wijnand-0/+23
2018-11-26Add missing link in docsGuillaume Gomez-1/+1
2018-11-26Remove unsafe `unsafe` inner function.Corey Farwell-5/+2
Within this `Iterator` implementation, a function `unsafe_get` is defined which unsafely allows _unchecked_ indexing of any element in a slice. This should be marked as _unsafe_, but it is not. To address this issue, I removed that inner function.
2018-11-26Auto merge of #55705 - ethanboxx:master, r=SimonSapinbors-1/+24
Make `ParseIntError` and `IntErrorKind` fully public Why would you write nice error types if I can't read them? # Why It can be useful to use `match` with errors produced when parsing strings to int. This would be useful for the `.err_match()` function in my [new crate](https://crates.io/crates/read_input). --- I could also do this for `ParseFloatError` if people think it is a good idea. I am new around hear so please tell me if I am getting anything wrong.
2018-11-25Add TryFrom<&[T]> for [T; $N] where T: CopySimon Sapin-0/+87
`TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists, but not needing to dereference makes type inference easier for example when using `u32::from_be_bytes`. Also add doc examples doing just that.
2018-11-25fix missing borrowEthan Brierley-1/+1
2018-11-25Use a reference rather than take ownershipEthan Brierley-1/+1
2018-11-25Add grammar for {f32,f64}::from_str, mention known bug.Corey Farwell-1/+25
- Original bug about documenting grammar - https://github.com/rust-lang/rust/issues/32243 - Known bug with parsing - https://github.com/rust-lang/rust/issues/31407
2018-11-25Rollup merge of #56207 - SimonSapin:int_to_from_bytes, r=nagisaPietro Albini-36/+12
Stabilize the int_to_from_bytes feature Fixes #52963 FCP to merge completed: https://github.com/rust-lang/rust/issues/52963#issuecomment-416548327
2018-11-25Rollup merge of #56101 - frewsxcv:frewsxcv-dyn, r=steveklabnikPietro Albini-1/+1
Incorporate `dyn` into more comments and docs. r? @rust-lang/docs
2018-11-25Stabilize the int_to_from_bytes featureSimon Sapin-36/+12
Fixes #52963
2018-11-23use more inlining, and force some of itRalf Jung-4/+13
2018-11-23use MaybeUninit in core::ptr::swap_nonoverlapping_bytesRalf Jung-4/+4
Code by @japaric, I just split it into individual commits
2018-11-23use MaybeUninit in core::ptr::swapRalf Jung-8/+5
Code by @japaric, I just split it into individual commits
2018-11-23use MaybeUninit in core::ptr::{read,read_unaligned}Ralf Jung-7/+7
Code by @japaric, I just split it into individual commits
2018-11-23use MaybeUninit in core::slice::rotateRalf Jung-9/+3
Code by @japaric, I just split it into individual commits
2018-11-23use MaybeUninit in core::slice::sortRalf Jung-7/+7
Code by @japaric, I just split it into individual commits
2018-11-23use MaybeUninit in core::fmtRalf Jung-13/+14
Code by @japaric, I just split it into individual commits
2018-11-23Merge branch 'master' into frewsxcv-dynCorey Farwell-36/+146
2018-11-24Rollup merge of #56162 - adrianheine:patch-1, r=withoutboatskennytm-4/+2
std::str Adapt documentation to reality
2018-11-24Rollup merge of #55869 - SimonSapin:iterate, r=alexcrichtonkennytm-2/+177
Add std::iter::unfold This adds an **unstable** ~`std::iter::iterate`~ `std::iter::unfold` function and ~`std::iter::Iterate`~ `std::iter::Unfold` type that trivially wrap a ~`FnMut() -> Option<T>`~ `FnMut(&mut State) -> Option<T>` closure to create an iterator. ~Iterator state can be kept in the closure’s environment or captures.~ This is intended to help reduce amount of boilerplate needed when defining an iterator that is only created in one place. Compare the existing example of the `std::iter` module: (explanatory comments elided) ```rust struct Counter { count: usize, } impl Counter { fn new() -> Counter { Counter { count: 0 } } } impl Iterator for Counter { type Item = usize; fn next(&mut self) -> Option<usize> { self.count += 1; if self.count < 6 { Some(self.count) } else { None } } } ``` … with the same algorithm rewritten to use this new API: ```rust fn counter() -> impl Iterator<Item=usize> { std::iter::unfold(0, |count| { *count += 1; if *count < 6 { Some(*count) } else { None } }) } ``` ----- This also add unstable `std::iter::successors` which takes an (optional) initial item and a closure that takes an item and computes the next one (its successor). ```rust let powers_of_10 = successors(Some(1_u16), |n| n.checked_mul(10)); assert_eq!(powers_of_10.collect::<Vec<_>>(), &[1, 10, 100, 1_000, 10_000]); ```
2018-11-24Rollup merge of #55838 - dralley:fix-cfg-step, r=Kimundikennytm-4/+4
Fix #[cfg] for step impl on ranges ```#[cfg(target_pointer_witdth = ...)]``` is misspelled
2018-11-22drop glue takes in mutable references, it should reflect that in its typeRalf Jung-2/+12
2018-11-22std::str Adapt documentation to realityAdrian Heine né Lang-4/+2
2018-11-22Auto merge of #56155 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-13/+118
Rollup of 11 pull requests Successful merges: - #55367 (lint if a private item has doctests) - #55485 (Return &T / &mut T in ManuallyDrop Deref(Mut) impl) - #55784 (Clarifying documentation for collections::hash_map::Entry::or_insert) - #55961 (Fix VecDeque pretty-printer) - #55980 (Suggest on closure args count mismatching with pipe span) - #56002 (fix #55972: Erroneous self arguments on bare functions emit subpar compilation error) - #56063 (Update any.rs documentation using keyword dyn) - #56067 (Add SGX target to rustc) - #56078 (Fix error message for `-C panic=xxx`.) - #56106 (Remove some incorrect doc comments) - #56126 (core/benches/num: Add `from_str/from_str_radix()` benchmarks) Failed merges: r? @ghost
2018-11-22Rollup merge of #56126 - Turbo87:bench-parse, r=alexcrichtonGuillaume Gomez-0/+105
core/benches/num: Add `from_str/from_str_radix()` benchmarks This was extracted from #55973 /cc @alexcrichton
2018-11-22Rollup merge of #56063 - 0xrgb:patch-1, r=joshtriplettGuillaume Gomez-11/+11
Update any.rs documentation using keyword dyn This will fix #56062.