about summary refs log tree commit diff
path: root/src/libcore/ops/mod.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-199/+0
2020-03-10Make Point `Copy` in arithmetic documentationFlorian Gilcher-1/+1
Small composite types like `Point { x: i32, y: i32}` are plain old data and we should encourage users to derive `Copy` on them. This changes the semantics of the edited examples slightly: instead of consuming the operands during addition, it will copy them. This is desired behaviour. Co-Authored-By: Jake Goulding <shepmaster@mac.com>
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-2/+2
2019-11-26Format libcore with rustfmtDavid Tolnay-4/+4
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-04-18libcore => 2018Taiki Endo-2/+2
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-20Stabilize `Rc`, `Arc` and `Pin` as method receiversMichael Hewson-0/+3
This lets you write methods using `self: Rc<Self>`, `self: Arc<Self>`, `self: Pin<&mut Self>`, `self: Pin<Box<Self>`, and other combinations involving `Pin` and another stdlib receiver type, without needing the `arbitrary_self_types`. Other user-created receiver types can be used, but they still require the feature flag to use. This is implemented by introducing a new trait, `Receiver`, which the method receiver's type must implement if the `arbitrary_self_types` feature is not enabled. To keep composed receiver types such as `&Arc<Self>` unstable, the receiver type is also required to implement `Deref<Target=Self>` when the feature flag is not enabled. This lets you use `self: Rc<Self>` and `self: Arc<Self>` in stable Rust, which was not allowed previously. It was agreed that they would be stabilized in #55786. `self: Pin<&Self>` and other pinned receiver types do not require the `arbitrary_self_types` feature, but they cannot be used on stable because `Pin` still requires the `pin` feature.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-01Replace CoerceSized trait with DispatchFromDynMichael Hewson-2/+2
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-01Add CoerceSized trait and lang itemMichael Hewson-0/+3
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-04-03Remove all unstable placement featuresAidan Hobson Sayers-4/+0
Closes #22181, #27779
2018-03-29Move RangeArguments to {core::std}::ops and rename to RangeBoundsSimon Sapin-1/+1
These unstable items are deprecated: * The `std::collections::range::RangeArgument` reexport * The `std::collections::range` module.
2018-03-29Move alloc::Bound to {core,std}::opsSimon Sapin-1/+1
The stable reexport `std::collections::Bound` is now deprecated. Another deprecated reexport could be added in `alloc`, but that crate is unstable.
2018-03-15Stabilize `inclusive_range` library feature.kennytm-1/+1
Stabilize std::ops::RangeInclusive and std::ops::RangeInclusiveTo.
2017-11-20Update books for next releasesteveklabnik-1/+1
Also includes a fix in std::ops
2017-10-02update books for next releasesteveklabnik-1/+1
Also fixes some stdlib links to the reference which have changed.
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-5/+12
2017-08-08Added to core::ops module docslukaramu-5/+12
Part of #29365. * Added paragraph adapted from API guidelines that operator implementations should be unsurprising * Modified Point example to be more clear when just reading it
2017-07-28Rename State to GeneratorStateJohn Kåre Alsaker-1/+1
2017-07-28Fill in generator tracking issue in a few more locationsAlex Crichton-1/+1
2017-07-28std: Add forwarding impls of `Generator` traitAlex Crichton-5/+1
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+8
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-3/+0
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-24Stabilize RangeArgumentSteven Fackler-0/+3
Move it and Bound to core::ops while we're at it. Closes #30877
2017-06-19Bump version and stage0 compilerAlex Crichton-3/+0
2017-06-09Move Drop to module.Clar Charr-90/+4
2017-06-09Move CoerceUnsized to module.Clar Charr-69/+3
2017-06-09Move Index to module.Clar Charr-149/+4
2017-06-09Move Deref to module.Clar Charr-110/+4
2017-06-09Move Try to module.Clar Charr-102/+7
2017-06-09Move placement new operators to module.Clar Charr-119/+4
2017-06-09Move bit ops to module.Clar Charr-830/+7
2017-06-09Move arithmetic ops to module.Clar Charr-864/+7
2017-06-09Move Fn to module.Clar Charr-185/+4
2017-06-07Move Range to module.Clar Charr-356/+8
2017-06-07Move ops.rs to folder.Clar Charr-0/+3021