about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-08-03volatile operations docs: clarify that this does not help wrt. concurrencyRalf Jung-0/+30
2018-08-03Provide `{to,from}_{ne,le,be}_bytes` functions on integersTobias Bucher-14/+86
If one doesn't view integers as containers of bytes, converting them to bytes necessarily needs the specfication of encoding. I think Rust is a language that wants to be explicit. The `to_bytes` function is basically the opposite of that – it converts an integer into the native byte representation, but there's no mention (in the function name) of it being very much platform dependent. Therefore, I think it would be better to replace that method by three methods, the explicit `to_ne_bytes` ("native endian") which does the same thing and `to_{le,be}_bytes` which return the little- resp. big-endian encoding.
2018-08-02Add #![feature(trim_direction)] to doc commentsvarkor-2/+14
2018-08-02Add trim_start, trim_end, trim_start_matches and trim_end_matchesvarkor-13/+159
2018-08-02Auto merge of #52949 - Mark-Simulacrum:snap, r=alexcrichtonbors-225/+17
Switch to bootstrapping from 1.29 beta r? @alexcrichton
2018-08-02test that align_of handles alignment properly for the mid partRalf Jung-0/+16
2018-08-02debug_assert to ensure that from_raw_parts is only used properly alignedRalf Jung-0/+2
2018-08-02Auto merge of #52206 - RalfJung:zst-slices, r=alexcrichtonbors-212/+277
slices: fix ZST slice iterators making up pointers; debug_assert alignment in from_raw_parts This fixes the problem that we are fabricating pointers out of thin air. I also managed to share more code between the mutable and shared iterators, while reducing the amount of macros. I am not sure how useful it really is to add a `debug_assert!` in libcore. Everybody gets a release version of that anyway, right? Is there at least a CI job that runs the test suite with a debug version? Fixes #42789
2018-08-02use the same length computation everywhereRalf Jung-21/+10
2018-08-02Introduce another way to compute the length, to fix position codegen regressionRalf Jung-8/+21
2018-08-02simplify len macro: No longer require the typeRalf Jung-12/+19
Also use ident, not expr, to avoid accidental side-effects
2018-08-02macro-inline len() and is_empty() to fix performance regressionsRalf Jung-20/+29
This also changes the IR for nth(), but the new IR actually looks nicer that the old (and it is one instruction shorter).
2018-08-02make the code for nth closer to what it used to beRalf Jung-3/+4
2018-08-02test nth betterRalf Jung-11/+37
2018-08-02use wrapping_offset; fix logic error in nthRalf Jung-10/+12
2018-08-02commentsRalf Jung-2/+3
2018-08-02slice iterators: ZST iterators no longer just "make up" addressesRalf Jung-211/+228
2018-08-01Auto merge of #52958 - pietroalbini:rollup, r=pietroalbinibors-10/+16
Rollup of 15 pull requests Successful merges: - #52793 (Add test for NLL: unexpected "free region `` does not outlive" error ) - #52799 (Use BitVector for global sets of AttrId) - #52809 (Add test for unexpected region for local data ReStatic) - #52834 ([NLL] Allow conflicting borrows of promoted length zero arrays) - #52835 (Fix Alias intra doc ICE) - #52854 (fix memrchr in miri) - #52899 (tests/ui: Add missing mips{64} ignores) - #52908 (Use SetLenOnDrop in Vec::truncate()) - #52915 (Don't count MIR locals as borrowed after StorageDead when finding locals live across a yield terminator) - #52926 (rustc: Trim down the `rust_2018_idioms` lint group) - #52930 (rustc_resolve: record single-segment extern crate import resolutions.) - #52939 (Make io::Read::read_to_end consider io::Take::limit) - #52942 (Another SmallVec.extend optimization) - #52947 (1.27 actually added the `armv5te-unknown-linux-musleabi` target) - #52954 (async can begin expressions) Failed merges: r? @ghost
2018-08-01Rollup merge of #52854 - RalfJung:memrchr, r=KimundiPietro Albini-10/+16
fix memrchr in miri The previous PR https://github.com/rust-lang/rust/pull/52744 was not enough because it assumed that the split between the `mid` and `end` parts returned by `align_to` was aligned. But really the only guarantee we have is that the `mid` part is aligned, so make use of that.
2018-08-01Switch to bootstrapping from 1.29 betaMark Rousskov-225/+17
2018-08-01Auto merge of #51609 - dscorbett:is_numeric, r=alexcrichtonbors-35/+50
Treat gc=No characters as numeric [`char::is_numeric`](https://doc.rust-lang.org/std/primitive.char.html#method.is_numeric) and [`char::is_alphanumeric`](https://doc.rust-lang.org/std/primitive.char.html#method.is_alphanumeric) are documented to be defined “in terms of the Unicode General Categories 'Nd', 'Nl', 'No'”, but unicode.py does not group 'No' with the other 'N' categories. These functions therefore currently return `false` for characters like ⟨¾⟩ and ⟨①⟩.
2018-08-01Rollup merge of #52905 - pravic:unsize-typo, r=alexcrichtonPietro Albini-1/+1
Fix a typo in unsize.rs RfC -> RFC
2018-08-01Rollup merge of #52870 - cramertj:unpin-futureobj, r=aturonPietro Albini-0/+3
Implement Unpin for FutureObj and LocalFutureObj cc @MajorBreakfast r? @aturon
2018-08-01Rollup merge of #52822 - MajorBreakfast:fix-from-local-waker, r=cramertjPietro Albini-3/+5
Fix From<LocalWaker> This is a follow-up to https://github.com/rust-lang/rust/pull/52640 Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken) r? @cramertj
2018-08-01Rollup merge of #52732 - SimonSapin:spring, r=Mark-SimulacrumPietro Albini-263/+0
Remove unstable and deprecated APIs
2018-07-31Fix a typo in unsize.rspravic-1/+1
RfC -> RFC
2018-07-31Auto merge of #50267 - humanenginuity:master, r=alexcrichtonbors-3/+162
Implement inner deref for Option and Result tracking issue: #50264
2018-07-31don't duplicate implsАртём Павлов [Artyom Pavlov]-17/+2
2018-07-30Implement Unpin for FutureObj and LocalFutureObjTaylor Cramer-0/+3
2018-07-30Remove unstable and deprecated APIsSimon Sapin-263/+0
2018-07-30fix memrchr in miriRalf Jung-10/+16
2018-07-30Revert "Stabilize to_bytes and from_bytes for integers."Simon Sapin-4/+12
This reverts commit c8f9b84b393915a48253e3edc862c15a9b7152a7.
2018-07-30change negativity checkАртём Павлов [Artyom Pavlov]-12/+12
2018-07-29resolved upstream merge conflictsBrad Gibson-4417/+7142
2018-07-29add MAX_NANOS_F64 constantАртём Павлов [Artyom Pavlov]-3/+4
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-1/+1
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-29Fix From<LocalWaker>Josef Reinhard Brandl-3/+5
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-2/+1
Misc cleanups
2018-07-29review updateАртём Павлов [Artyom Pavlov]-26/+19
2018-07-29duration div mul extrasАртём Павлов [Artyom Pavlov]-0/+115
2018-07-28Auto merge of #52744 - RalfJung:align_offset, r=Kimundibors-10/+7
make memrchr use align_offset I hope I did not screw that up... Cc @oli-obk who authored the original https://github.com/rust-lang/rust/pull/44537 Fixes #50567 (thanks @bjorn3)
2018-07-28Auto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakisbors-92/+236
Change ManuallyDrop<T> to a lang item. This PR implements the approach @RalfJung proposes in https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025 (lang item `struct` instead of `union`). A followup PR can easily solve #47034 as well, by just adding a few `?Sized` to `libcore/mem.rs`. r? @nikomatsakis
2018-07-28Rollup merge of #52777 - omni-viral:master, r=TimNNkennytm-2/+2
Fix doc comment for 'ptr::copy_to' method Fix error in doc comment for `ptr::copy_to` method.
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-58/+62
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-27Use str::repeatShotaro Yamada-2/+1
2018-07-27Fix doc comment for 'ptr::copy_to' methodZakarum-2/+2
2018-07-27add smoke test for ManuallyDropRalf Jung-0/+25
2018-07-27use slice::align_toRalf Jung-26/+7
2018-07-27Prefer to_string() to format!()ljedrz-1/+1
2018-07-26make memrchr use align_offsetRalf Jung-1/+17