about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-07-01Enable mem_take feature in relevant cratesChris Gregory-0/+1
2019-07-01Use mem::take instead of mem::replace with defaultChris Gregory-1/+1
2019-07-01Address review remarks in unicode.pyPaweł Romanowski-55/+61
2019-07-01Remove needless lifetimesJeremy Stucki-3/+3
2019-06-30Update mem::replace example to not be identical to mem::takeChris Gregory-8/+20
This also adds assertions that the operations work as expected.
2019-06-30Make sure `#[rustc_doc_only_macro]` and other rustc attributes are registeredVadim Petrochenkov-0/+1
2019-06-29Add missing type urls in Into traitGuillaume Gomez-2/+3
2019-06-29Add missing links for TryFrom docsGuillaume Gomez-9/+11
2019-06-30fix the same typo in doctestlcolaholicl-2/+2
2019-06-30Fix a typolcolaholicl-1/+1
Fix a typo in `libcore/char/methods.rs`
2019-06-29Rollup merge of #62204 - Hywan:patch-2, r=rkruppeMazdak Farrokhzad-1/+1
doc(libcore) Fix CS A small PR to fix a small CS typo in `iter/traits/collect.rs`.
2019-06-29Rollup merge of #61199 - ollie27:rustdoc_cfg_test, r=QuietMisdreavusMazdak Farrokhzad-6/+9
Revert "Set test flag when rustdoc is running with --test option" Reverts https://github.com/rust-lang/rust/pull/59940. It caused doctests in this repository to no longer be tested including all of the core crate.
2019-06-28doc(libcore) Fix CSIvan Enderlin-1/+1
A small PR to fix a small CS typo in `iter/traits/collect.rs`.
2019-06-27Rollup merge of #62067 - doctorn:await_diagnostic, r=matthewjasperMazdak Farrokhzad-0/+1
Add suggestion for missing `.await` keyword This commit adds a suggestion diagnostic for missing `.await`. In order to do this, the trait `Future` is promoted to a lang item. Compiling code of the form: ```rust #![feature(async_await)] fn take_u32(x: u32) {} async fn make_u32() -> u32 { 22 } async fn foo() { let x = make_u32(); take_u32(x) } fn main() {} ``` Will now result in the suggestion: ``` error[E0308]: mismatched types --> src/main.rs:11:18 | 11 | take_u32(x) | ^ | | | expected u32, found opaque type | help: consider using `.await` here: `x.await` | = note: expected type `u32` found type `impl std::future::Future` ``` This commit does not cover chained expressions and therefore only covers the case originally pointed out in #61076. Cases I can think of that still need to be covered: - [ ] Return places for functions - [ ] Field access - [ ] Method invocation I'm planning to submit PRs for each of these separately as and when I have figured them out.
2019-06-27Rollup merge of #61878 - RalfJung:pin, r=Dylan-DPCMazdak Farrokhzad-41/+130
improve pinning projection docs This tries to improve the explanation of structural pinning and pinning projections based on [this URLO thread](https://users.rust-lang.org/t/when-is-it-safe-to-move-a-member-value-out-of-a-pinned-future/28182). Fixes https://github.com/rust-lang/rust/issues/61272.
2019-06-27Add suggestion for missing `.await` keywordNathan Corbyn-0/+1
2019-06-23squash of all commits for nth_back on ChunksMut@amit.chandra-0/+41
wip nth_back for chunks_mut working chunksmut fixed nth_back for chunksmut Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
2019-06-23Rollup merge of #62068 - ia0:fix_meta_var, r=petrochenkovMazdak Farrokhzad-18/+18
Fix meta-variable binding errors in macros The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact. Found by https://github.com/rust-lang/rust/pull/62008
2019-06-23Rollup merge of #62049 - crlf0710:patch-2, r=jonas-schievinkMazdak Farrokhzad-1/+1
Fix one missing `dyn`. It's in the documentation of `Unsize`.
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-18/+18
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-06-23squash commit for nth_back on chunks exact@amit.chandra-0/+34
wip nth_back for chunks_exact working nth_back for chunks exact Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
2019-06-22Auto merge of #61874 - jonas-schievink:remove-rem-output-default, r=Centrilbors-2/+1
Remove the default type of `Rem::Output` Associated type defaults are not yet stable, and `Rem` is the only trait that specifies a default. Let's see what breaks when it's removed. cc https://github.com/rust-lang/rust/pull/61812#issuecomment-502394566 cc @Centril @bors try
2019-06-22Fix one missing `dyn`.CrLF0710-1/+1
It's in the documentation of `Unsize`.
2019-06-20Auto merge of #61929 - 95th:master, r=GuillaumeGomezbors-13/+13
Fix Into trait docs links https://doc.rust-lang.org/std/convert/trait.Into.html
2019-06-20Fix Into trait linksGurwinder Singh-13/+13
2019-06-20Rollup merge of #60772 - timvermeulen:slice_iter_nth_back, r=scottmcmMazdak Farrokhzad-21/+68
Implement nth_back for slice::{Iter, IterMut} Part of #54054. I implemented `nth_back` as straightforwardly as I could, and then slightly changed `nth` to match `nth_back`. I believe I did so correctly, but please double-check 🙂 I also added the helper methods `zst_shrink`, `next_unchecked`, and `next_back_unchecked` to get rid of some duplicated code. These changes hopefully make this code easier to understand for new contributors like me. I noticed the `is_empty!` and `len!` macros which sole purpose seems to be inlining, according to the comment right above them, but the `is_empty` and `len` methods are already marked with `#[inline(always)]`. Does that mean we could replace these macros with method calls, without affecting anything? I'd love to get rid of them.
2019-06-20Rollup merge of #60454 - acrrd:issues/54054_skip, r=scottmcmMazdak Farrokhzad-0/+48
Add custom nth_back to Skip Implementation of nth_back for Skip. Part of #54054
2019-06-19Remove mentions of removed `offset_to` methodPhilipp Oppermann-2/+2
2019-06-19Rollup merge of #60667 - oli-obk:raw_from_raw_parts, r=sfacklerMazdak Farrokhzad-16/+50
Add functions for building raw slices to libcore implement https://github.com/rust-lang/rust/issues/36925
2019-06-19nitsRalf Jung-2/+4
2019-06-19Apply suggestions from code reviewRalf Jung-4/+4
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-06-19Add functions to build raw slicesOliver Scherer-16/+50
2019-06-19Auto merge of #61945 - Centril:rollup-xdqo2mn, r=Centrilbors-1/+16
Rollup of 11 pull requests Successful merges: - #61505 (Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages) - #61701 (move stray run-pass const tests into const/ folder) - #61748 (Tweak transparent enums and unions diagnostic spans) - #61802 (Make MaybeUninit #[repr(transparent)]) - #61839 (ci: Add a script for generating CPU usage graphs) - #61842 (Remove unnecessary lift calls) - #61843 (Turn down the myriad-closures test) - #61896 (rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.) - #61898 (syntax: Factor out common fields from `SyntaxExtension` variants) - #61938 (create an issue for miri even in status test-fail) - #61941 (Preserve generator and yield source for error messages) Failed merges: r? @ghost
2019-06-19Rollup merge of #61802 - mjbshaw:maybe-uninit-transparent, r=cramertjMazdak Farrokhzad-1/+16
Make MaybeUninit #[repr(transparent)] Tracking issue: #60405
2019-06-18Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddybbors-44/+187
Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively): - redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag` - add `Clone` for `VaListImpl` - add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList` - add deref coercion from `VaList` to `VaListImpl` - add support for the `asmjs` target All these changes were needed for use cases like: ```Rust let mut ap2 = va_copy(ap); vprintf(fmt, ap2); va_end(&mut ap2); ```
2019-06-18Make MaybeUninit #[repr(transparent)]Michael Bradshaw-1/+16
Tracking issue: #60405
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-44/+187
Clone for it.
2019-06-17Rollup merge of #61885 - scottmcm:slice-iter-len-opt, r=rkruppe,RalfJungMazdak Farrokhzad-4/+23
Help LLVM better optimize slice::Iter(Mut)::len r? @RalfJung I've included a codegen test that fails without this change as a demonstration of usefulness.
2019-06-16make example code typecheck at leastRalf Jung-3/+11
2019-06-16keep links in local crate where possibleRalf Jung-9/+9
2019-06-15Help LLVM better optimize slice::Iter(Mut)::lenScott McMurray-4/+23
2019-06-16Stabilize todo macroStjepan Glavina-6/+10
2019-06-16minor editsRalf Jung-9/+9
2019-06-15mention that overwrite-without-drop also violates the drop guarantee, and ↵Ralf Jung-8/+14
link some more stuff
2019-06-15explain better that structural pinning is a per-field choiceRalf Jung-29/+102
2019-06-15Remove the default type of `Rem::Output`Jonas Schievink-2/+1
2019-06-15Rollup merge of #61844 - AaronKutch:master, r=CentrilMazdak Farrokhzad-39/+39
Change `...` to `..=` where applicable This is mainly to fix #61816, but I decided to manually check a few thousand `...` throughout the code base to check for any other cases. I think I found a documentation bug in `src\libsyntax\ast.rs` where both `1..` and `1...` where mentioned. If there is internal support for both `1..` and `1..=` (that can exist before error handling gets to it), then I can add that back. There were some other cases that look like `// struct Closure<'l0...'li, T0...Tj, CK, CS, U0...Uk> {`, `// <P0 as Trait<P1...Pn>>::Foo: 'a`, and `assert!(min <= max, "discriminant range is {}...{}", min, max);`, but I am not sure if I should change those. There are a bunch of cases in the `/test/` directory that could be changed, but I presume I should just leave those be.
2019-06-15Rollup merge of #61785 - RalfJung:as-ref, r=rkruppeMazdak Farrokhzad-3/+35
note some safety concerns of raw-ptr-to-ref casts
2019-06-14Change `...` to `..=` where applicableAaron Kutch-39/+39
2019-06-14note some safety concerns of raw-ptr-to-ref castsRalf Jung-3/+35