about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-10-26Remove unnecessary mut in iterator.find_map documentation example, Relates ↵Méven Car-1/+1
to #49098
2018-10-25Rollup merge of #55269 - matthiaskrgr:typos_oct, r=zackmdavisPietro Albini-4/+4
fix typos in various places
2018-10-25Rollup merge of #55251 - NieDzejkob:master, r=TimNNPietro Albini-1/+1
Fix a typo in the documentation of RangeInclusive
2018-10-25Rollup merge of #53507 - phungleson:fix-impl-from-for-waker, r=cramertjPietro Albini-0/+5
Add doc for impl From for Waker As part of issue #51430 (cc @skade). The impl is very simple, so not sure if we need to go into any details.
2018-10-24Update comment based on suggestion.Son-2/+3
2018-10-23fix typos in various placesMatthias Krüger-4/+4
2018-10-21Add MaybeUninit::newSimon Sapin-0/+10
Sometimes it *is* initialized!
2018-10-21Fix a typo in the documentation of RangeInclusiveJakub Kądziołka-1/+1
2018-10-19Stabilize impl_header_lifetime_elision in 2015Scott McMurray-2/+2
It's already stable in 2018; this finishes the stabilization.
2018-10-19Rollup merge of #55178 - sdroege:stabilize-chunks-exact, r=alexcrichtonkennytm-63/+49
Stabilize slice::chunks_exact(), chunks_exact_mut(), rchunks(), rchunks_mut(), rchunks_exact(), rchunks_exact_mut() Fixes #47115, #55177
2018-10-18Auto merge of #54979 - estebank:path-unsized, r=nikomatsakisbors-0/+1
Custom E0277 diagnostic for `Path` r? @nikomatsakis we have a way to target `Path` exclusively, we need to identify the correct text to show to consider #23286 fixed.
2018-10-18Stabilize slice::rchunks(), rchunks_mut(), rchunks_exact(), rchunk_exact_mut()Sebastian Dröge-41/+32
Fixes #55177
2018-10-18Stabilize slice::chunks_exact() and slice::chunks_exact_mut()Sebastian Dröge-22/+17
Fixes #47115
2018-10-18Auto merge of #54580 - sdroege:rchunks, r=SimonSapinbors-33/+940
Add slice::rchunks(), rchunks_mut(), rchunks_exact() and rchunks_exact_mut() These work exactly like the normal chunks iterators but start creating chunks from the end of the slice. ---- The new iterators were motivated by a [comment](https://github.com/rust-lang/rust/issues/47115#issuecomment-424141121) by @DutchGhost. ~~~This currently includes the commits from https://github.com/rust-lang/rust/pull/54537 to not have to rename things twice or have merge conflicts. I'll force-push a new version of the branch ones those are in master.~~~ Also the stabilization tracking issue is just some number right now. I'll create the corresponding issue once this is reviewed and otherwise mergeable. cc @DutchGhost
2018-10-18Add slice::rchunks(), rchunks_mut(), rchunks_exact() and rchunks_exact_mut()Sebastian Dröge-33/+940
These work exactly like the normal chunks iterators but start creating chunks from the end of the slice. See #55177 for the tracking issue
2018-10-17Auto merge of #54946 - estebank:iterator, r=varkorbors-1/+62
Add filtering option to `rustc_on_unimplemented` and reword `Iterator` E0277 errors - Add more targetting filters for arrays to `rustc_on_unimplemented` (Fix #53766) - Detect one element array of `Range` type, which is potentially a typo: `for _ in [0..10] {}` where iterating between `0` and `10` was intended. (Fix #23141) - Suggest `.bytes()` and `.chars()` for `String`. - Suggest borrowing or `.iter()` on arrays (Fix #36391) - Suggest using range literal when iterating on integers (Fix #34353) - Do not suggest `.iter()` by default (Fix #50773, fix #46806) - Add regression test (Fix #22872)
2018-10-17Seems like we don't have to refer the file anymore.Son-4/+1
2018-10-17Add doc for impl From for WakerSon-0/+7
2018-10-15Rollup merge of #55060 - jannic:patch-1, r=joshtriplettManish Goregaokar-6/+6
clarify pointer add/sub function safety concerns Ralf Jung made the same changes to the offset functions' documentation in commit fb089156. As add/sub just call offset, the same limitation applies here, as well. I did not copy the whole explanation ("In particular, the resulting pointer may *not* be used to access a different allocated object [...]") because I'd consider that as being too repetitive. The documentation of add/sub already refers to the offset function, so people interested in the details can look it up, there. But changing 'an object' to 'the same object' is a small change which improves clarity a lot.
2018-10-15Rollup merge of #55047 - tshepang:simple, r=alexcrichtonManish Goregaokar-3/+2
doc: make core::fmt::Error example more simple
2018-10-14remove unnecessary emphasis in doc commentJan Niehusmann-2/+2
During review of the previous commit, @joshtriplett noticed that the emphasis on 'the same' is unnecessary. For consistency, remove it on the offset() functions, as well.
2018-10-14clarify pointer add/sub function safety concernsJan Niehusmann-4/+4
Ralf Jung made the same changes to the offset functions' documentation in commit fb089156. As add/sub just call offset, the same limitation applies here, as well. Removed emphasis on review request by @joshtriplett
2018-10-14Unused result warning: "X which must" ↦ "X that must"varkor-1/+1
2018-10-13Use read_unaligned instead of read in transmute_copyArtyom Pavlov-1/+1
Closes: #55044 This change could result in performance regression on non-x86 platforms. Alternative would be to update `transmute_copy` with alignment requirements.
2018-10-13doc: make core::fmt::Error example more simpleTshepang Lekhonkhobe-3/+2
2018-10-12Auto merge of #54534 - nagisa:align-offset-simplification, r=alexcrichtonbors-26/+13
Simplify implementation of align_offset slightly
2018-10-11Reword Range*/[Range*]: Iterator E0277 messagesEsteban Küber-6/+22
2018-10-11review commentsEsteban Küber-4/+28
- reword messages - apply custom comments to all types of ranges - fix indentation
2018-10-10Custom E0277 diagnostic for `Path`Esteban Küber-0/+1
2018-10-10Rollup merge of #54904 - Kerollmops:stabilize-option-replace, r=CentrilManish Goregaokar-4/+1
Fixes #47311. r? @nrc
2018-10-10Auto merge of #54732 - cramertj:waker, r=aturonbors-32/+33
LocalWaker and Waker cleanups r? @aturon
2018-10-09fix tidyEsteban Küber-2/+4
2018-10-09Reword `rustc_on_unimplemented` errors for `Iterator`Esteban Küber-1/+20
- Detect one element array of `Range` type, which is potentially a typo: `for _ in [0..10] {}` where iterating between `0` and `10` was intended. (#23141) - Suggest `.bytes()` and `.chars()` for `String`. - Suggest borrowing or `.iter()` on arrays (#36391) - Suggest using range literal when iterating on integers (#34353) - Do not suggest `.iter()` by default (#50773, #46806)
2018-10-08Bump the `Option::replace` stabilize version to 1.31.0Clément Renault-1/+1
2018-10-08Stabilize the `Option::replace` methodClément Renault-4/+1
2018-10-08Auto merge of #54700 - frewsxcv:frewsxcv-binary-search, r=GuillaumeGomezbors-10/+13
Clarify docs for when binary_search has many matches. Fixes https://github.com/rust-lang/rust/issues/51817.
2018-10-07Clarify docs for when binary_search has many matches.Corey Farwell-10/+13
Fixes https://github.com/rust-lang/rust/issues/51817.
2018-10-05Linkify types in docsHavvy (Ryan Scheel)-1/+1
2018-10-05Slice total example: Move closer to total defnHavvy (Ryan Scheel)-6/+9
2018-10-05Example of total ord of elements for sort_byHavvy (Ryan Scheel)-0/+6
2018-10-05Doc total order requirement of sort(_unstable)_byHavvy (Ryan Scheel)-0/+7
I took the definition of what a total order is from the Ord trait docs. I specifically put "elements of the slice" because if you have a slice of f64s, but know none are NaN, then sorting by partial ord is total in this case. I'm not sure if I should give such an example in the docs or not.
2018-10-05Auto merge of #54017 - alexcrichton:wasm-atomics2, r=sfacklerbors-0/+9
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-03Only promote calls to `#[rustc_promotable]` const fnsOliver Schneider-0/+11
2018-10-02Rollup merge of #54687 - scottmcm:more-elision, r=dtolnayPietro Albini-148/+150
Use impl_header_lifetime_elision in libcore The feature is approved for stabilization, so let's use it to remove about 300 `'a`s. Tracking issue for the feature: https://github.com/rust-lang/rust/issues/15872
2018-10-01LocalWaker and Waker cleanupsTaylor Cramer-32/+33
2018-10-01Rollup merge of #53784 - tbu-:pr_doc_slice_isize_max, r=RalfJungkennytm-3/+14
Document that slices cannot be larger than `isize::MAX` bytes Fixes #53676.
2018-09-30Simplify implementation of align_offset slightlySimonas Kazlauskas-26/+13
2018-09-30Auto merge of #54596 - mjbshaw:drop, r=RalfJungbors-0/+10
Make core::mem::needs_drop a const fn This fixes #51929.
2018-09-29Activate the feature in the libcore tests tooScott McMurray-0/+1
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-148/+149