summary refs log tree commit diff
path: root/library/core/src
AgeCommit message (Collapse)AuthorLines
2020-09-28Rename Iterator::get_unchecked -> Iterator::__iterator_get_uncheckedMark Rousskov-28/+32
Backport of #77201, manually done because of file renaming.
2020-09-28update tracking issue for const_type_idAshley Mannix-2/+2
2020-09-28revert const_type_id stabilizationAshley Mannix-2/+3
This reverts commit e3856616ee2a894c7811a7017d98fafa7ba84dd8.
2020-08-24Stabilize Range[Inclusive]::is_emptyScott McMurray-12/+2
I would like to propose these two simple methods for stabilization: - Knowing that a range is exhaused isn't otherwise trivial - Clippy would like to suggest them, but had to do extra work to disable that path <https://github.com/rust-lang/rust-clippy/issues/3807> because they're unstable - These work on `PartialOrd`, consistently with now-stable `contains`, and are thus more general than iterator-based approaches that need `Step` - They've been unchanged for some time, and have picked up uses in the compiler - Stabilizing them doesn't block any future iterator-based is_empty plans, as the inherent ones are preferred in name resolution
2020-08-24Auto merge of #75815 - jyn514:ambiguous-primitives, r=guillaumegomezbors-2/+33
Report an ambiguity if both modules and primitives are in scope for intra-doc links Closes https://github.com/rust-lang/rust/issues/75381 - Add a new `prim@` disambiguator, since both modules and primitives are in the same namespace - Refactor `report_ambiguity` into a closure Additionally, I noticed that rustdoc would previously allow `[struct@char]` if `char` resolved to a primitive (not if it had a DefId). I fixed that and added a test case. I also need to update libstd to use `prim@char` instead of `type@char`. If possible I would also like to refactor `ambiguity_error` to use `Disambiguator` instead of its own hand-rolled match - that ran into issues with `prim@` (I updated one and not the other) and it would be better for them to be in sync.
2020-08-24Auto merge of #75855 - jyn514:no-cfg-doc, r=ollie27bors-1/+2
Use allow(unused_imports) instead of cfg(doc) for imports used only for intra-doc links This prevents links from breaking when items are re-exported in a different crate and the original isn't being documented. Spotted in https://github.com/rust-lang/rust/pull/75832#discussion_r475275837 (thanks ollie!) r? @ollie27
2020-08-23Don't import atomics unless supported by the platformJoshua Nelson-0/+1
2020-08-24Rollup merge of #75851 - camelid:patch-2, r=jyn514Yuki Okushi-3/+0
Switch to intra-doc links in `core::array` Part of #75080. @rustbot modify labels: A-intra-doc-links T-doc T-rustdoc
2020-08-24Rollup merge of #75831 - lzutao:https, r=Dylan-DPCYuki Okushi-1/+1
doc: Prefer https link for wikipedia URLs A tiny changes.
2020-08-24Rollup merge of #75826 - ↵Yuki Okushi-2/+2
ayushmishra2005:misleading_documentation_for_derived_Ord_PartialOrd, r=KodrAus Corrected Misleading documentation for derived Ord/PartialOrd implementation Corrected Misleading documentation for derived Ord/PartialOrd implementation Fixes #75620
2020-08-24Rollup merge of #75825 - jrheard:patch-1, r=steveklabnikYuki Okushi-1/+1
Fix typo in documentation of i32 wrapping_abs() Hi! I was reading through the std library docs and noticed that this section flowed a bit oddly; comparing it against https://doc.rust-lang.org/std/primitive.i32.html#method.wrapping_div and https://doc.rust-lang.org/std/primitive.i32.html#method.wrapping_neg , I noticed that those two pieces of documentation used a semicolon here. This is my first time submitting a PR to this repo. Am I doing this right? Are tiny typo-fix PRs like this worth submitting, or are they not a good use of time? Thank you!
2020-08-24Rollup merge of #75819 - LeSeulArtichaut:core-intra-docs-2, r=jyn514Yuki Okushi-114/+30
Use intra-doc-links in `core::{char, macros, fmt}` Helps with #75080. r? @jyn514
2020-08-23Disambiguate char -> prim@char for `core`Joshua Nelson-2/+33
This also changes human intuition -> intuition. 'human intuition' sounds vaguely menacing.
2020-08-23Use allow(unused_imports) instead of cfg(doc)Joshua Nelson-1/+1
This prevents links from breaking when items are re-exported in a different crate and the original isn't being documented.
2020-08-24Use intra-doc-links in `core::{char, macros, fmt}`LeSeulArtichaut-114/+30
2020-08-23Switch to intra-doc links in `core::array`Camelid-3/+0
2020-08-23Auto merge of #72449 - ecstatic-morse:const-float-bitcast, r=RalfJungbors-34/+68
Const floating point bitcasts and classification Makes the `f32` and `f64` methods described in #72447 and #72505 unstably const. r? @RalfJung
2020-08-23Auto merge of #74238 - RalfJung:offset_from, r=oli-obkbors-123/+46
stabilize ptr_offset_from This stabilizes ptr::offset_from, and closes https://github.com/rust-lang/rust/issues/41079. It also removes the deprecated `wrapping_offset_from`. This function was deprecated 19 days ago and was never stable; given an FCP of 10 days and some waiting time until FCP starts, that leaves at least a month between deprecation and removal which I think is fine for a nightly-only API. Regarding the open questions in https://github.com/rust-lang/rust/issues/41079: * Should offset_from abort instead of panic on ZSTs? -- As far as I know, there is no precedent for such aborts. We could, however, declare this UB. Given that the size is always known statically and the check thus rather cheap, UB seems excessive. * Should there be more methods like this with different restrictions (to allow nuw/nsw, perhaps) or that return usize (like how isize-taking offset is more conveniently done with usize-taking add these days)? -- No reason to block stabilization on that, we can always add such methods later. Also nominating the lang team because this exposes an intrinsic. The stabilized method is best described [by its doc-comment](https://github.com/RalfJung/rust/blob/56d4b2d69abb93e4f0ca79471deca7aaaaeca214/src/libcore/ptr/const_ptr.rs#L227). The documentation forgot to mention the requirement that both pointers must "have the same provenance", aka "be derived from pointers to the same allocation", which I am adding in this PR. This is a precondition that [Miri already implements](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a3b9d0a07a01321f5202cd99e9613480) and that, should LLVM ever obtain a `psub` operation to subtract pointers, will likely be required for that operation (following the semantics in [this paper](https://people.mpi-sws.org/~jung/twinsem/twinsem.pdf)).
2020-08-23bump stable versionRalf Jung-2/+2
Co-authored-by: Josh Stone <cuviper@gmail.com>
2020-08-23Misleading documentation for derived Ord/PartialOrd implementation for enums ↵Ayush Kumar Mishra-2/+2
#75620
2020-08-23Prefer https link for wikipedia URLsLzu Tao-1/+1
2020-08-22Fix typo in documentation of i32 wrapping_abs()JR Heard-1/+1
2020-08-22Use intra-doc-links in `core::{raw, ffi, pin}`LeSeulArtichaut-34/+15
2020-08-22Add `#![feature(const_float_classify)]` for `f64::classify` and friendsDylan MacKenzie-18/+35
2020-08-22Add `#![feature(const_float_bits_conv)]` for `f64::to_bits` and friendsDylan MacKenzie-16/+33
2020-08-22Auto merge of #75783 - denisvasilik:intra-doc-links-core-alloc, r=jyn514bors-3/+2
Move to intra-doc links for library/core/src/alloc/{layout, global, mod}.rs Helps with #75080. The files already contained intra-doc links, so there are only minor changes. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc Known issues: * [`handle_alloc_error`]: Link from `core` to `alloc` could not be resolved. * [`slice`]: slice is a primitive type, but could not be resolved; had to use [`crate::slice`] instead.
2020-08-22fix dead links to wrapping_offset_fromRalf Jung-14/+4
2020-08-22remove feature gate from testsRalf Jung-8/+0
2020-08-22stabilize ptr_offset_fromRalf Jung-2/+2
2020-08-22remove deprecated wrapping_offset_fromRalf Jung-103/+0
2020-08-22offset_from: also document same-provenance requirementRalf Jung-0/+44
2020-08-22Link to primitive instead of moduleDenis Vasilik-1/+2
2020-08-22Rollup merge of #75787 - LeSeulArtichaut:core-intra-doc, r=jyn514Dylan DPC-47/+18
Use intra-doc-links in `core::ops::*` Helps with #75080. r? @jyn514
2020-08-22Rollup merge of #75782 - GuillaumeGomez:more-links, r=jyn514Dylan DPC-57/+57
Convert core/src/str/pattern.rs to Intra-doc links Part of #75080.
2020-08-22Rollup merge of #75705 - denisvasilik:intra-doc-links-intrinsics, r=jyn514Dylan DPC-466/+235
Move to intra-doc links for /library/core/src/intrinsics.rs Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc Known issues: * The following f32 and f64 primitive methods cannot be resolved: f32/f64::powi f32/f64::sqrt f32/f64::sin f32/f64::cos f32/f64::powf f32/f64::exp f32/f64::exp2 f32/f64::ln f32/f64::log2 f32/f64::log10 f32/f64::mul_add f32/f64::abs f32/f64::copysign f32/f64::floor f32/f64::ceil f32/f64::trunc f32/f64::round * Links from core to std: [`std::pointer::*`] [`std::process::abort`] [`from_raw_parts`] [`Vec::append`] * Links with anchors? I provided a separate commit that replaced links with anchors by intra-doc links. Here the anchor location information gets lost, so its questionable whether to actually replace those links.
2020-08-22Add more linksGuillaume Gomez-46/+55
2020-08-21Remove links that get imported from the preludeLeSeulArtichaut-14/+3
2020-08-21Use intra-doc-links in `core::ops::*`LeSeulArtichaut-45/+27
2020-08-21Use intra-doc linksDenis Vasilik-3/+2
2020-08-21Use intra-doc linksDenis Vasilik-2/+1
2020-08-21Convert links to intra-doc links formatGuillaume Gomez-11/+2
2020-08-21Rework imports used solely for docsDenis Vasilik-7/+2
2020-08-21Apply auto-formatterDenis Vasilik-3/+3
2020-08-21Incorporate suggestions from reviewDenis Vasilik-457/+233
2020-08-21Rollup merge of #75727 - camelid:intra-doc-links-for-core-result, r=jyn514Yuki Okushi-69/+16
Switch to intra-doc links in `core::result` Part of #75080. @rustbot modify labels: A-intra-doc-links T-doc T-rustdoc
2020-08-20Auto merge of #73565 - matthewjasper:core-min-spec, r=nagisabors-200/+390
Use min_specialization in libcore Getting `TrustedRandomAccess` to work is the main interesting thing here. - `get_unchecked` is now an unstable, hidden method on `Iterator` - The contract for `TrustedRandomAccess` is made clearer in documentation - Fixed a bug where `Debug` would create aliasing references when using the specialized zip impl - Added tests for the side effects of `next_back` and `nth`. closes #68536
2020-08-20Fix intra-doc links Camelid-2/+2
One of the original links was linking to the wrong thing as well. Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-19Revert to old link since intra-doc link is brokenCamelid-1/+1
Can't link from `core` to `std` yet.
2020-08-19Auto merge of #75563 - richkadel:llvm-coverage-map-gen-5.4, r=wesleywiserbors-64/+0
Moved coverage counter injection from BasicBlock to Statement. As discussed on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Implement.20LLVM-compatible.20source-based.20cod.20compiler-team.23278
2020-08-19Switch to intra-doc links in `core::result`Camelid-68/+15