about summary refs log tree commit diff
path: root/src/libcore/hash
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-1115/+0
2020-07-09libstd/libcore: fix various typosAndy Russell-1/+1
2020-06-30Deny unsafe ops in unsafe fns, part 6LeSeulArtichaut-1/+0
And final part!!!
2020-06-30Deny unsafe ops in unsafe fns, part 2LeSeulArtichaut-3/+8
2020-06-27Forward Hash::write_iN to Hash::write_uNNikita Popov-5/+5
2020-04-23Add a note about fat pointersLeSeulArtichaut-0/+6
Co-Authored-By: Mark-Simulacrum <mark.simulacrum@gmail.com>
2020-04-23Add note about paddingLeSeulArtichaut-2/+3
Co-authored-by: Mark-Simulacrum <mark.simulacrum@gmail.com>
2020-04-12Document unsafety in `src/libcore/hash/sip.rs`LeSeulArtichaut-3/+8
2020-04-11Document unsafety in `src/libcore/hash/mod.rs`LeSeulArtichaut-2/+7
2020-03-15Rollup merge of #69471 - nnethercote:rm-sip-Hasher-short_write, r=dtolnayDylan DPC-46/+7
Remove `sip::Hasher::short_write`. `sip::Hasher::short_write` is currently unused. It is called by `sip::Hasher::write_{u8,usize}`, but those methods are also unused, because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement any of the `write_xyz` methods, so all their write operations end up calling `sip::Hasher::write`. (I confirmed this by inserting a `panic!` in `sip::Hasher::short_write` and running the tests -- they all passed.) The alternative would be to add all the missing `write_xyz` methods. This does give some significant speed-ups, but it hurts compile times a little in some cases. See #69152 for details. This commit does the conservative thing and doesn't change existing behaviour. r? @rust-lang/libs
2020-02-26clarify operator precedenceMatthias Krüger-1/+1
2020-02-26Remove `sip::Hasher::short_write`.Nicholas Nethercote-46/+7
`sip::Hasher::short_write` is currently unused. It is called by `sip::Hasher::write_{u8,usize}`, but those methods are also unused, because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement any of the `write_xyz` methods, so all their write operations end up calling `sip::Hasher::write`. (I confirmed this by inserting a `panic!` in `sip::Hasher::short_write` and running the tests -- they all passed.) The alternative would be to add all the missing `write_xyz` methods. This does give some significant speed-ups, but it hurts compile times a little in some cases. See #69152 for details. This commit does the conservative thing and doesn't change existing behaviour.
2020-02-21Revert `u8to64_le` changes from #68914.Nicholas Nethercote-1/+3
`SipHasher128`'s `u8to64_le` function was simplified in #68914. Unfortunately, the new version is slower, because it introduces `memcpy` calls with non-statically-known lengths. This commit reverts the change, and adds an explanatory comment (which is also added to `libcore/hash/sip.rs`). This barely affects `SipHasher128`'s speed because it doesn't use `u8to64_le` much, but it does result in `SipHasher128` once again being consistent with `libcore/hash/sip.rs`.
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-6/+6
2019-11-26Format libcore with rustfmtDavid Tolnay-60/+69
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-06Have tidy ensure that we document all `unsafe` blocks in libcoreOliver Scherer-0/+4
2019-09-25Snap cfgs to new betaMark Rousskov-1/+0
2019-09-23Move `--cfg bootstrap` out of `rustc.rs`Alex Crichton-1/+1
Instead let's do this via `RUSTFLAGS` in `builder.rs`. Currently requires a submodule update of `stdarch` to fix a problem with previous compilers.
2019-08-17Make built-in derives opaque macrosMatthew Jasper-1/+1
2019-08-14Auto merge of #63534 - Mark-Simulacrum:stage0-bump, r=Centrilbors-2/+0
Bump to 1.39 r? @Centril
2019-08-14Handle cfg(bootstrap) throughoutMark Rousskov-2/+0
2019-08-09Remove unneeded comment in src/libcore/hash/mod.rssd234678-2/+0
2019-08-10Give built-in macros stable addresses in the standard libraryVadim Petrochenkov-0/+15
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-3/+3
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-04-19libcore: deny more...Mazdak Farrokhzad-1/+1
2019-04-18libcore => 2018Taiki Endo-9/+10
2019-04-15Hasher: replace unsafe trasmute with to_ne_bytesStepan Koltsov-14/+10
Spead the knowledge of `to_ne_bytes` functions existence.
2019-02-10libs: doc commentsAlexander Regueiro-3/+3
2019-01-28libcore: remove unneeded allow(deprecated)Ralf Jung-1/+1
2018-12-25Remove licensesMark Rousskov-20/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-3/+3
2018-07-15impl PartialEq+Eq for BuildHasherDefaultMarco Neumann-0/+10
2018-06-14impl Hash for !Clar Charr-0/+7
2018-03-26Fix a few more unstables that I missedMark Mansi-2/+2
2018-03-17Mark deprecated unstable SipHasher13 as a doc-hidden impl detail of HashMap.Simon Sapin-6/+8
It stays in libcore rather than being private in HashMap’s module because it shares code with the deprecated *stable* `SipHasher` type.
2018-03-17Make the deprecated unstable SipHasher24 type private.Simon Sapin-40/+7
It is still used by the deprecated *stable* `SipHasher` type.
2017-11-10Fix broken link markup in Hasher::finish docsLukas H-1/+1
There were apostrophes when there needed to be backticks.
2017-10-25Implement Hash for raw pointers to unsized typesMatt Brubeck-4/+24
2017-10-20Fix most rendering warnings from switching to CommonMarksteveklabnik-3/+3
2017-10-16rustc_data_structures: Add implementation of 128 bit SipHash.Michael Woerister-0/+1
2017-09-12impl Hasher for {&mut Hasher, Box<Hasher>}kennytm-0/+46
2017-08-16Document that std::hash::Hasher::finish() does not reset the hasher.Martin Hoffmann-1/+8
2017-07-20std: Cut down #[inline] annotations where not necessaryAlex Crichton-1/+1
This PR cuts down on a large number of `#[inline(always)]` and `#[inline]` annotations in libcore for various core functions. The `#[inline(always)]` annotation is almost never needed and is detrimental to debug build times as it forces LLVM to perform inlining when it otherwise wouldn't need to in debug builds. Additionally `#[inline]` is an unnecessary annoation on almost all generic functions because the function will already be monomorphized into other codegen units and otherwise rarely needs the extra "help" from us to tell LLVM to inline something. Overall this PR cut the compile time of a [microbenchmark][1] by 30% from 1s to 0.7s. [1]: https://gist.github.com/alexcrichton/a7d70319a45aa60cf36a6a7bf540dd3a
2017-07-02Implement Eq/Hash/Debug etc. for unsized tuples.Masaki Hara-1/+6
2017-06-16Introduce tidy lint to check for inconsistent tracking issuesest31-1/+1
This commit * Refactors the collect_lib_features function to work in a non-checking mode (no bad pointer needed, and list of lang features). * Introduces checking whether unstable/stable tags for a given feature have inconsistent tracking issues. * Fixes such inconsistencies throughout the codebase.
2017-05-02Removal pass for anonymous parametersest31-2/+2
Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue #41686 and RFC 1685.
2017-04-10Fixed indent, grammar, and link in std::hash docslukaramu-4/+4
2017-04-07improved std::hash::Hasher docslukaramu-2/+57
Part of #29357. * rephrased summary sentences to be less redundant * expanded top-level docs, adding a usage example and links to relevant methods (`finish`, `write` etc) as well as `Hash` * added examples to the `finish` and `write` methods
2017-04-06improved std::hash::Hash docslukaramu-22/+61
Part of #29357. * merged "Derivable" and "How can I implement `Hash`?" sections into one "Implementing `Hash`" section to aid coherency * added an example for `#[derive(Hash)]` * moved part about relation between `Hash` and `Eq` into a new "`Hash` and `Eq`" section; changed wording to be more consistent with `HashMap` and `HashSet`'s * explicitly mentioned `#[derive(PartialEq, Eq, Hash)]` in the new section * changed method summaries for consistency, adding links and examples