about summary refs log tree commit diff
path: root/src/libcore/ops
AgeCommit message (Collapse)AuthorLines
2020-04-25Bump bootstrap compilerMark Rousskov-3/+2
2020-04-13Remove the last remnant of unsigned NegJosh Stone-17/+4
It's been gone since #23945, before Rust 1.0. The former wrapping semantics have also been available as inherent methods for a long time now. There's no reason to keep this unused macro around.
2020-04-05Stop importing the float modules. Use assoc constsLinus Färnstrand-12/+0
2020-04-03Replace float module consts with assoc consts in documentationLinus Färnstrand-6/+4
2020-03-26permit negative impls for non-auto traitsNiko Matsakis-0/+4
2020-03-23#[track_caller] on core::ops::{Index, IndexMut}.Adam Perry-0/+2
2020-03-19Removed unused `Hasher` import.CDirkx-1/+1
2020-03-19Derive PartialEq, Eq and Hash for RangeInclusiveCDirkx-21/+1
The manual implementation of PartialEq, Eq and Hash for RangeInclusive was functionally equivalent to a derived implementation. This change removes the manual implementation and adds the respective derives. A side effect of this change is that the derives also add implementations for StructuralPartialEq and StructuralEq, which enables RangeInclusive to be used in const generics.
2020-03-15Bump the bootstrap compilerJonas Schievink-29/+2
2020-03-10Make Point `Copy` in arithmetic documentationFlorian Gilcher-6/+6
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>
2020-02-08Remove problematic specialization from RangeInclusiveCAD97-31/+14
2020-02-08Auto merge of #68358 - matthewjasper:spec-fix, r=nikomatsakisbors-23/+15
Remove some unsound specializations This removes the unsound and exploitable specializations in the standard library * The `PartialEq` and `Hash` implementations for `RangeInclusive` are changed to avoid specialization. * The `PartialOrd` specialization for slices now specializes on a limited set of concrete types. * Added some tests for the soundness problems.
2020-02-02Add a resume type parameter to `Generator`Jonas Schievink-4/+31
2020-02-01Remove some unsound specializationsMatthew Jasper-23/+15
2019-12-26Convert collapsed to shortcut reference linksMatthew Kraai-4/+4
2019-12-23Document that calling Drop, even after it panics, is UBMark Rousskov-0/+6
2019-12-22Rollup merge of #67480 - rossmacarthur:fix-41260-avoid-issue-0-part-2, r=CentrilMazdak Farrokhzad-10/+10
Require issue = "none" over issue = "0" in unstable attributes These changes make the use of `issue = "none"` required in unstable attributes throughout the compiler. Notes: - #66299 is now in beta so `issue = "none"` is accepted. - The `tidy` tool now fails on `issue = "0"`. - Tests that used `issue = "0"` were changed to use `issue = "none"`, except for _one_ that asserts `issue = "0"` can still be used. - The compiler still allows `issue = "0"` because some submodules require it, this could be disallowed once these are updated. Resolves #41260 r? @varkor
2019-12-21Document privacy of RangeInclusive fieldsMark Rousskov-0/+5
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-10/+10
2019-12-18Propagate cfg bootstrapMark Rousskov-28/+19
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-0/+9
functions with a `const` modifier
2019-12-06Format libcore with rustfmt (including tests and benches)David Tolnay-14/+22
2019-12-03Rollup merge of #66651 - Areredify:on-unimplemented-scope, r=davidtwcoMazdak Farrokhzad-3/+4
Add `enclosing scope` parameter to `rustc_on_unimplemented` Adds a new parameter to `#[rustc_on_unimplemented]`, `enclosing scope`, which highlights the function or closure scope with a message. The wip part refers to adding this annotation to `Try` trait to improve ergonomics (which I don't know how to do since I change both std and librustc) Closes #61709.
2019-11-26Format libcore with rustfmtDavid Tolnay-136/+180
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-11-25added enclosing_scope attr to Try trait and fixed ui tests accordinglyMikhail Babenko-3/+4
2019-11-16Suggest borrowing when it would satisfy an unmet trait boundEsteban Küber-4/+0
When there are multiple implementors for the same trait that is present in an unmet binding, modify the E0277 error to refer to the parent obligation and verify whether borrowing the argument being passed in would satisfy the unmet bound. If it would, suggest it.
2019-11-12Snap cfgsMark Rousskov-15/+2
2019-11-01Rollup merge of #65902 - gilescope:issue62570, r=estebankTyler Mandry-2/+15
Make ItemContext available for better diagnositcs Fix #62570
2019-10-30Make ItemContext available for better diagnositcs.Giles Cope-2/+15
2019-10-20Remove leading :: from paths in doc examplesMikko Rantanen-1/+1
2019-08-24Added an extra line to make the formatting conform to the rest of the document.Christian-0/+1
2019-08-24Removed the confusing FnOnce example. closes #47091Christian-9/+0
2019-07-25Add note suggesting to borrow a String argument to findEsteban Küber-0/+4
2019-07-11hygiene: Fix wording of desugaring descriptionsVadim Petrochenkov-2/+2
Use variant names rather than descriptions for identifying desugarings in `#[rustc_on_unimplemented]`. Both are highly unstable, but variant name is at least a single identifier.
2019-07-01Remove needless lifetimesJeremy Stucki-2/+2
2019-06-15Remove the default type of `Rem::Output`Jonas Schievink-1/+1
2019-06-06Rollup merge of #61376 - czipperz:bound-cloned, r=sfacklerMazdak Farrokhzad-0/+23
Add Bound::cloned() Suggested by #61356
2019-06-05Remove dereferenceChris Gregory-1/+1
Co-Authored-By: Steven Fackler <sfackler@gmail.com>
2019-06-05Take self by value (Self is Copy here)Chris Gregory-1/+1
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-1/+1
2019-06-01Enable feature bound_cloned for testsChris Gregory-0/+1
2019-05-31Make Bound::cloned publicChris Gregory-1/+1
2019-05-30Fix compilation errorsChris Gregory-2/+2
2019-05-30Add Bound::cloned()Chris Gregory-0/+22
2019-05-30Fix links in Deref documentationGuillaume Gomez-6/+6
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-04-19libcore: deny more...Mazdak Farrokhzad-6/+6
2019-04-18libcore => 2018Taiki Endo-5/+5
2019-04-09std::ops::Div examples: correct nominator to numeratorAnders Kaseorg-14/+14
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-04-04Rollup merge of #59596 - LukasKalbertodt:fix-range-fmt, r=KimundiMazdak Farrokhzad-5/+17
Forward formatter settings to bounds of `Range<T>` in `fmt::Debug` impl Before this change, formatter settings were lost when printing a `Range`. For example, printing a `Range<f32>` with `{:.2?}` would not apply the precision modifier when printing the floats. Now the `Debug` impls look a bit more verbose, but modifier are not lost. --- I assume the exact output of `Debug` impls in `std` cannot be relied on by users and thus can change, right?