about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-11-09Fix #[cfg] for step impl on rangesDaniel Alley-4/+4
2018-11-10make PhantomData #[structural_match].Mazdak Farrokhzad-0/+2
2018-11-10revert spurious edits.Mazdak Farrokhzad-15/+5
2018-11-10revert some more constification.Mazdak Farrokhzad-1/+1
2018-11-10revert making internal APIs const fn.Mazdak Farrokhzad-23/+23
2018-11-10reduce list to functions callable in const ctx.Mazdak Farrokhzad-25/+25
2018-11-10constify parts of libstd.Mazdak Farrokhzad-0/+0
2018-11-10constify parts of libcore.Mazdak Farrokhzad-80/+82
2018-11-10constify libcore/time.rsMazdak Farrokhzad-8/+4
2018-11-09Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`Oliver Scherer-0/+2
2018-11-08Fix Rc/Arc allocation layoutMurarth-0/+17
* Rounds allocation layout up to a multiple of alignment * Adds a convenience method `Layout::pad_to_align` to perform rounding
2018-11-08Use T: ?Sized in intrinsics::forgetStjepan Glavina-1/+1
2018-11-08Allow unsized types in mem::drop and mem::forgetStjepan Glavina-1/+124
2018-11-08Auto merge of #55366 - Amanieu:stable_layout, r=Amanieubors-24/+16
Add tracking issue for Layout methods (and some API changes) These methods are already useful when used with the stable global allocator API (stabilized in #51241). ```rust pub fn align_to(&self, align: usize) -> Result<Layout, LayoutErr>; pub fn padding_needed_for(&self, align: usize) -> usize; pub fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutErr>; pub fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutErr>; pub fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutErr>; pub fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutErr>; pub fn array<T>(n: usize) -> Result<Layout, LayoutErr>; ``` cc #32838 r? @SimonSapin
2018-11-07Rollup merge of #55377 - goffrie:patch-2, r=joshtriplettkennytm-4/+5
Slight copy-editing for `std::cell::Cell` docs Hopefully this is a bit more precise and also more correct English.
2018-11-07add unstable attributeEthan Brierley-0/+4
2018-11-07Fix incorrect documentationEthan Brierley-2/+2
2018-11-07Use method rather than public fieldEthan Brierley-2/+5
2018-11-06Add a tracking issue for extra Layout methodsAmanieu d'Antras-7/+7
2018-11-06API changes as discussed in the commentsAmanieu d'Antras-17/+6
2018-11-06Add a comment about how Layout::extend matches the C struct layoutAmanieu d'Antras-0/+3
2018-11-06Document kind fieldEthan Brierley-0/+1
2018-11-06Fix mistake in my markdownEthan Brierley-0/+2
2018-11-06Add very useful documentationEthan Brierley-0/+8
2018-11-05Continue to try to make travis happy by adding a issue numberEthan Brierley-1/+2
2018-11-05break line to keep `travis_fold:start:tidy` happyEthan Brierley-1/+2
2018-11-05Add useful attributesEthan Brierley-0/+3
2018-11-05Auto merge of #55410 - nagisa:atomic-align, r=pnkfelixbors-0/+56
Correct alignment of atomic types and (re)add Atomic{I,U}128 This is a updated https://github.com/rust-lang/rust/pull/53514 to also make atomic types `repr(C)` as per comment in https://github.com/rust-lang/rust/pull/53514#issuecomment-431042767. Fixes #39590 Closes #53514 r? @pnkfelix
2018-11-05Make `ParseIntError` and `IntErrorKind` fully publicEthan Brierley-2/+2
2018-11-05Do not Atomic{I,U}128 in stage0Simonas Kazlauskas-2/+2
2018-11-03Implement rotate using funnel shift on LLVM >= 7Nikita Popov-2/+26
Implement the rotate_left and rotate_right operations using llvm.fshl and llvm.fshr if they are available (LLVM >= 7). Originally I wanted to expose the funnel_shift_left and funnel_shift_right intrinsics and implement rotate_left and rotate_right on top of them. However, emulation of funnel shifts requires emitting a conditional to check for zero shift amount, which is not necessary for rotates. I was uncomfortable doing that here, as I don't want to rely on LLVM to optimize away that conditional (and for variable rotates, I'm not sure it can). We should revisit that question when we raise our minimum version requirement to LLVM 7 and don't need emulation code anymore.
2018-11-01update DispatchFromDyn doctestMichael Hewson-0/+3
2018-11-01Replace CoerceSized trait with DispatchFromDynMichael Hewson-36/+35
Rename `CoerceSized` to `DispatchFromDyn`, and reverse the direction so that, for example, you write ``` impl<T: Unsize<U>, U> DispatchFromDyn<*const U> for *const T {} ``` instead of ``` impl<T: Unsize<U>, U> DispatchFromDyn<*const T> for *const U {} ``` this way the trait is really just a subset of `CoerceUnsized`. The checks in object_safety.rs are updated for the new trait, and some documentation and method names in there are updated for the new trait name — e.g. `receiver_is_coercible` is now called `receiver_is_dispatchable`. Since the trait now works in the opposite direction, some code had to updated here for that too. I did not update the error messages for invalid `CoerceSized` (now `DispatchFromDyn`) implementations, except to find/replace `CoerceSized` with `DispatchFromDyn`. Will ask for suggestions in the PR thread.
2018-11-01fix docs on traitMichael Hewson-4/+4
tests were failing because I didn't wrap code snippets like in backticks. fixed that now, so hopefully tests will pass on travis
2018-11-01Add CoerceSized impls throughout libstdMichael Hewson-3/+18
This will make receiver types like `Rc<Self>` and `Pin<&mut Self>` object-safe.
2018-11-01Add CoerceSized trait and lang itemMichael Hewson-1/+35
This trait is more-or-less the reverse of CoerceUnsized, and will be used for object-safety checks. Receiver types like `Rc` will have to implement `CoerceSized` so that methods that use `Rc<Self>` as the receiver will be considered object-safe.
2018-11-01Rollup merge of #55578 - regexident:fix/self, r=frewsxcvkennytm-2/+2
Made doc example of `impl Default for …` use `-> Self` instead of explicit self type There is no need to state the explicit type of `self`.
2018-11-01Made doc example of `impl Default for …` use `-> Self` instead of explicit ↵Vincent Esche-2/+2
self type
2018-10-31Bump nightly to 1.32.0Alex Crichton-22/+11
* Also update the bootstrap compiler * Update cargo to 1.32.0 * Clean out stage0 annotations
2018-10-30Add link to std::mem::size_of to size_of intrinsic documentationFlorian Hartwig-0/+4
2018-10-29Return &T / &mut T in ManuallyDrop Deref(Mut) implPeter Todd-2/+2
Without this change the generated documentation looks like this: fn deref(&self) -> &<ManuallyDrop<T> as Deref>::Target Returning the actual type directly makes the generated docs more clear: fn deref(&self) -> &T
2018-10-29Rollup merge of #55426 - fitzgen:nonnull-inline, r=SimonSapinPietro Albini-0/+14
Make a bunch of trivial methods of NonNull be `#[inline]` I was seeing super trivial methods not getting inlined in some of my builds, so I went ahead and just marked all the methods inline where it seemed appropriate. r? @SimonSapin
2018-10-28Rollup merge of #55421 - CAD97:patch-1, r=kennytmkennytm-0/+20
Add ManuallyDrop::take Tracking issue: #55422 Proposed in this form in https://internals.rust-lang.org/t/mini-rfc-manuallydrop-take/8679, see that thread for some history. A small convenience wrapper for `ManuallyDrop` that makes a pattern (taking ownership of the contained data in drop) more obvious.
2018-10-28Rollup merge of #55389 - meven:master, r=shepmasterkennytm-1/+1
Remove unnecessary mut in iterator.find_map documentation example, R… Relates to #49098 Removes a mut that could induce newcomers to put a mut in their code that the compiler would comply about. https://github.com/rust-lang/rust/pull/49098/files#r227422388
2018-10-28Rollup merge of #55252 - SimonSapin:maybeuninit-new, r=blusskennytm-0/+10
Add MaybeUninit::new Sometimes it *is* initialized!
2018-10-28Add ManuallyDrop::takeChristopher Durham-0/+20
https://internals.rust-lang.org/t/mini-rfc-manuallydrop-take/8679
2018-10-28Make a bunch of trivial methods of NonNull be `#[inline]`Nick Fitzgerald-0/+14
2018-10-27Make the Atomic types repr(C) to ensure newtypeSimonas Kazlauskas-5/+5
2018-10-27Correct alignment of atomic types and (re)add Atomic{I,U}128Oliver Middleton-0/+56
LLVM requires that atomic loads and stores be aligned to at least the size of the type.
2018-10-26Slight copy-editing for `std::cell::Cell` docsGeoffry Song-4/+5
Hopefully this is a bit more precise and also more correct English.