rust/src/libcore
bors 1d5f6d41e1 Auto merge of #68165 - thomcc:lt_ones, r=sfackler
Add leading_ones and trailing_ones methods to the primitive integer types

I was surprised these were missing (given that `leading_zeros` and `trailing_zeros` exist), and they seem trivial and hopefully not controversial.

Note that there's some precedent in that `count_ones` and `count_zeros` are both supported even though only one of these has an intrinsic.

I'm not sure if these need a `rustc_const_unstable` flag (the tests don't seem to mind that it's missing). I just made them const, since there's not really any reason for these to be non-const when the `_zeros` variants are const.

Note: My understanding is trivial stuff like (hopefully) this can land without an RFC, but I'm not fully sure about the process though. Questions like "when does the tracking issue get filed?", are a total mystery to me. So, any guidance is appreciated, and sorry in advance if I should have gone through some more involved process for this.
2020-01-27 08:42:56 +00:00
..
array Format the world 2019-12-22 17:42:47 -05:00
benches Format the world 2019-12-22 17:42:47 -05:00
char Replace old tables with new unicode data 2020-01-14 19:11:28 -05:00
convert Use Self instead of $type 2020-01-06 04:33:31 +00:00
fmt Use Self instead of self return type 2020-01-24 17:43:57 +01:00
future Revert "core: add IntoFuture trait and support for await" 2019-12-31 19:18:08 -05:00
hash Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
iter Avoid overflow in std::iter::Skip::count 2020-01-22 20:28:28 +00:00
macros macros: typo fix 2020-01-06 01:55:24 +00:00
mem stabalize ManuallyDrop::take 2020-01-09 13:32:10 -05:00
num Mark leading_trailing_ones with tracking issue 57969 2020-01-15 08:31:24 -08:00
ops Convert collapsed to shortcut reference links 2019-12-26 05:27:55 -08:00
prelude Format libcore with rustfmt 2019-11-26 23:02:11 -08:00
ptr get rid of real_drop_in_place again 2020-01-18 11:15:56 +01:00
slice Use NonNull in slice::Iter and slice::IterMut. 2019-12-26 20:18:31 +01:00
str Fix formatting: ./x.py fmt 2020-01-16 18:50:53 -08:00
sync Add SAFETY comment for atomic example 2020-01-16 19:26:02 -08:00
task Use matches macro in libcore and libstd 2020-01-08 07:10:28 +03:00
tests Auto merge of #68165 - thomcc:lt_ones, r=sfackler 2020-01-27 08:42:56 +00:00
unicode Replace old tables with new unicode data 2020-01-14 19:11:28 -05:00
alloc.rs Added minor clarification to specification of realloc. 2020-01-20 10:09:51 +00:00
any.rs Rollup merge of #68342 - lcnr:type_name_docs, r=Dylan-DPC 2020-01-18 19:36:08 +01:00
ascii.rs Format libcore with rustfmt 2019-11-26 23:02:11 -08:00
bool.rs Format libcore with rustfmt (including tests and benches) 2019-12-06 20:20:51 -08:00
borrow.rs Format the world 2019-12-22 17:42:47 -05:00
Cargo.toml Move the matches! macro to the prelude 2019-10-23 15:35:36 +02:00
cell.rs Elaborate on SAFETY comments 2020-01-16 18:32:21 -08:00
clone.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
cmp.rs Use matches macro in libcore and libstd 2020-01-08 07:10:28 +03:00
default.rs Format libcore with rustfmt 2019-11-26 23:02:11 -08:00
ffi.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
hint.rs Format libcore with rustfmt (including tests and benches) 2019-12-06 20:20:51 -08:00
internal_macros.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
intrinsics.rs Use issue = "none" instead of "0" in intrinsics 2019-12-25 11:54:55 +01:00
lib.rs slice_patterns: remove internal uses of gate 2020-01-18 19:33:47 +01:00
marker.rs Use Self instead of $type 2020-01-06 04:33:31 +00:00
option.rs use diagnostic_item and modify wording 2020-01-23 11:51:56 -08:00
panic.rs Format the world 2019-12-22 17:42:47 -05:00
panicking.rs core and std macros and panic internals use panic::Location::caller. 2020-01-04 10:02:17 -08:00
pin.rs Relax the Sized bounds on Pin::map_unchecked(_mut) 2020-01-06 15:41:09 +01:00
raw.rs Fix more tests after revert of rustdoc cfg(test) feature 2019-06-09 18:15:53 +01:00
result.rs use diagnostic_item and modify wording 2020-01-23 11:51:56 -08:00
time.rs no longer promote non-pattern const functions 2019-12-22 18:37:22 +01:00
tuple.rs Format libcore with rustfmt 2019-11-26 23:02:11 -08:00
unit.rs Format libcore with rustfmt 2019-11-26 23:02:11 -08:00