about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-25remove copyright headers now that they are not madatoryNiv Kaminer-10/+0
2018-08-24Auto merge of #53662 - kennytm:rollup, r=kennytmbors-40/+74
Rollup of 16 pull requests Successful merges: - #53311 (Window Mutex: Document that we properly initialize the SRWLock) - #53503 (Discourage overuse of mem::forget) - #53545 (Fix #50865: ICE on impl-trait returning functions reaching private items) - #53559 (add macro check for lint) - #53562 (Lament the invincibility of the Turbofish) - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()) - #53592 (docs: minor stylistic changes to str/string docs) - #53594 (Update RELEASES.md to include clippy-preview) - #53600 (Fix a grammatical mistake in "expected generic arguments" errors) - #53614 (update nomicon and book) - #53617 (tidy: Stop requiring a license header) - #53618 (Add missing fmt examples) - #53636 (Prefer `.nth(n)` over `.skip(n).next()`.) - #53644 (Use SmallVec for SmallCStr) - #53664 (Remove unnecessary closure in rustc_mir/build/mod.rs) - #53666 (Added rustc_codegen_llvm to compiler documentation.)
2018-08-24Rollup merge of #53636 - frewsxcv:frewsxcv-nth, r=rkruppekennytm-1/+1
Prefer `.nth(n)` over `.skip(n).next()`. Found by clippy.
2018-08-24Rollup merge of #53618 - GuillaumeGomez:fmt-examples, r=QuietMisdreavuskennytm-0/+66
Add missing fmt examples r? @QuietMisdreavus
2018-08-23Stabilize 'attr_literals' feature.Sergio Benitez-1/+0
2018-08-23Add missing fmt examplesGuillaume Gomez-0/+66
2018-08-23Discourage overuse of mem::forgetKornel-39/+7
2018-08-23Prefer `.nth(n)` over `.skip(n).next()`.Corey Farwell-1/+1
Found by clippy.
2018-08-23link to items in pin module to std docsNiv Kaminer-4/+4
2018-08-23adjust PinMut import in Unpin docsNiv Kaminer-1/+2
2018-08-23link Unpin to pin module documentationNiv Kaminer-0/+2
2018-08-23reexport Unpin into pin moduleNiv Kaminer-1/+1
2018-08-23capitalize and punctuate libcore pin moduleNiv Kaminer-1/+1
2018-08-23fix broken link to Unpin due to reexportNiv Kaminer-1/+1
2018-08-23fix PinMut documentationNiv Kaminer-4/+8
2018-08-23fix link to PinMutNiv Kaminer-1/+1
2018-08-23add top-level documentation to the std pin moduleNiv Kaminer-0/+4
2018-08-23move PinMut into pin module and export through stdNiv Kaminer-150/+168
2018-08-22Rollup merge of #53574 - vorner:ptr_as_ref_unchecked, r=Mark-SimulacrumGuillaume Gomez-0/+30
Suggest direct raw-pointer dereference People often come looking for some kind of `as_ref_unchecked` method on raw pointers that would give them `&T` and not `Option<&T>` when they are sure the pointer is not NULL. There's no such method, but taking a reference of the dereferenced pointer accomplishes the same thing. Therefore, suggest using that, at the `as_ref` site ‒ it's a place people are likely going to look into.
2018-08-22use char pattern for single-character splits: a.split("x") -> a.split('x')Matthias Krüger-1/+1
2018-08-21Add another PartialEq exampleGuillaume Gomez-1/+84
2018-08-21Suggest direct raw-pointer dereferenceMichal 'vorner' Vaner-0/+30
People often come looking for some kind of `as_ref_unchecked` method on raw pointers that would give them `&T` and not `Option<&T>` when they are sure the pointer is not NULL. There's no such method, but taking a reference of the dereferenced pointer accomplishes the same thing. Therefore, suggest using that, at the `as_ref` site ‒ it's a place people are likely going to look into.
2018-08-21Rollup merge of #53329 - frewsxcv:frewsxcv-ptr-add-sub, r=RalfJungkennytm-52/+52
Replace usages of ptr::offset with ptr::{add,sub}. Rust provides these helper methods – so let's use them!
2018-08-21Rollup merge of #53104 - nivkner:unpin_doc, r=RalfJungkennytm-4/+24
expand the documentation on the `Unpin` trait provides an overview of the Pin API which the trait is for, and show how it can be used in making self referencial structs part of #49150
2018-08-21Rollup merge of #53363 - llogiq:num-individual-nonzero-docs, r=steveklabnikkennytm-20/+23
add individual docs to `core::num::NonZero*`
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-6/+6
Fix typos found by codespell.
2018-08-21Rollup merge of #53296 - estebank:suggest-closure, r=KodrAuskennytm-0/+15
When closure with no arguments was expected, suggest wrapping Fix #49694.
2018-08-20Replace usages of ptr::offset with ptr::{add,sub}.Corey Farwell-52/+52
2018-08-20core::convert::identity: fix issue number to #53500Mazdak Farrokhzad-1/+1
2018-08-20Add doc for impl From in char_convertSon-0/+8
2018-08-19remove feature(convert_id) from lib{core,std}/lib.rsMazdak Farrokhzad-1/+0
2018-08-19Make core::convert::identity a const fn.Mazdak Farrokhzad-1/+2
2018-08-19Drop `identity` from prelude.Mazdak Farrokhzad-3/+0
2018-08-19Merge branch 'master' into feature/core_convert_idMazdak Farrokhzad-6320/+25263
2018-08-19Fix typos found by codespell.Matthias Krüger-6/+6
2018-08-19Auto merge of #52972 - RalfJung:from_raw_parts_align, r=alexcrichtonbors-0/+18
debug_assert to ensure that from_raw_parts is only used properly aligned This does not help nearly as much as I would hope because everybody uses the distributed libstd which is compiled without debug assertions. For this reason, I am not sure if this is even worth it. OTOH, this would have caught the misalignment fixed by https://github.com/rust-lang/rust/issues/42789 *if* there had been any tests actually using ZSTs with alignment >1 (we have a CI runner which has debug assertions in libstd enabled), and it seems to currently [fail in the rg testsuite](https://ci.appveyor.com/project/rust-lang/rust/build/1.0.8403/job/v7dfdcgn8ay5j6sb). So maybe it is worth it, after all. I have seen the attribute `#[rustc_inherit_overflow_checks]` in some places, does that make it so that the *caller's* debug status is relevant? Is there a similar attribute for `debug_assert!`? That could even subsume `rustc_inherit_overflow_checks`: Something like `rustc_inherit_debug_flag` could affect *all* places that change the generated code depending on whether we are in debug or release mode. In fact, given that we have to keep around the MIR for generic functions anyway, is there ever a reason *not* to handle the debug flag that way? I guess currently we apply debug flags like `cfg` so this is dropped early during the MIR pipeline? EDIT: I learned from @eddyb that because of how `debug_assert!` works, this is not realistic. Well, we could still have it for the rustc CI runs and then maybe, eventually, when libstd gets compiled client-side and there is both a debug and a release build... then this will also benefit users.^^
2018-08-17clarify use of Unpin and pinning typesNiv Kaminer-2/+4
2018-08-17Rollup merge of #53358 - SimonSapin:int-bytes, r=shepmasterCorey Farwell-18/+90
`{to,from}_{ne,le,be}_bytes` for unsigned integer types Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers. Tracking issue: https://github.com/rust-lang/rust/issues/52963
2018-08-17Gratuitous at byte boundaries in hex i32 literals in some doc-testsSimon Sapin-4/+4
2018-08-17Rollup merge of #53395 - varkor:__Nonexhaustive-to-non_exhaustive, r=shepmasterkennytm-24/+2
Use #[non_exhaustive] on internal enums This replaces `__Nonexhaustive` variants (and variants thereof) with `#[non_exhaustive]`. These were mostly unstable previously, with the exception of the `cloudabi` enums and `Level` in proc_macro: these were `#[doc(hidden)]`, so clearly intended not to be used directly. It should be safe to replace all of these.
2018-08-16Auto merge of #53256 - ollie27:writeln, r=KodrAusbors-5/+3
Don't accept non-string literals for the format string in writeln This is to improve diagnostics. `println` and `eprintln` were already fixed by #52394. Fixes #30143
2018-08-16add example for moving out of pointerNiv Kaminer-4/+15
2018-08-15When closure with no arguments was expected, suggest wrappingEsteban Küber-0/+15
2018-08-15Fix since of Iterator::flatten to be a proper semverAleksey Kladov-7/+7
2018-08-15Make core::sync::atomic::Ordering #[non_exhaustive]varkor-24/+2
2018-08-15Stablize Iterator::find_mapAleksey Kladov-5/+1
2018-08-14add individual docs to `core::num::NonZero*`Andre Bogus-20/+23
2018-08-14`{to,from}_{ne,le,be}_bytes` for unsigned integer typesSimon Sapin-16/+88
Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers. Tracking issue: https://github.com/rust-lang/rust/issues/52963
2018-08-14Auto merge of #53033 - RalfJung:manually_dro, r=SimonSapinbors-3/+11
unsized ManuallyDrop I think this matches what @eddyb had in https://github.com/rust-lang/rust/pull/52711 originally. ~~However, I have never added a `CoerceUnsized` before so I am not sure if I did this right. I copied the `unstable` attribute on the `impl` from elsewhere, but AFAIK it is useless because `impl`'s are insta-stable... so shouldn't this rather say "stable since 1.30"?~~ This is insta-stable and hence requires FCP, at least. Fixes https://github.com/rust-lang/rust/issues/47034