rust/library/core/src
bors 3e7514670d Auto merge of #94963 - lcnr:inherent-impls-std, r=oli-obk,m-ou-se
allow arbitrary inherent impls for builtin types in core

Part of https://github.com/rust-lang/compiler-team/issues/487. Slightly adjusted after some talks with `@m-ou-se` about the requirements of `t-libs-api`.

This adds a crate attribute `#![rustc_coherence_is_core]` which allows arbitrary impls for builtin types in core.

For other library crates impls for builtin types should be avoided if possible. We do have to allow the existing stable impls however. To prevent us from accidentally adding more of these in the future, there is a second attribute `#[rustc_allow_incoherent_impl]` which has to be added to **all impl items**. This only supports impls for builtin types but can easily be extended to additional types in a future PR.

This implementation does not check for overlaps in these impls. Perfectly checking that requires us to check the coherence of these incoherent impls in every crate, as two distinct dependencies may add overlapping methods. It should be easy enough to detect if it goes wrong and the attribute is only intended for use inside of std.

The first two commits are mostly unrelated cleanups.
2022-03-30 12:28:50 +00:00
..
alloc Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
array remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
async_iter
char remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
convert Rollup merge of #92541 - asquared31415:from-docs, r=m-ou-se 2022-03-09 23:14:10 +01:00
ffi merge the char signess list of archs with freebsd as it is the same 2022-03-02 12:12:28 +00:00
fmt revert changes that cast functions to raw pointers, portability hazard 2022-03-29 20:18:27 -04:00
future
hash Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
iter Rollup merge of #93950 - T-O-R-U-S:use-modern-formatting-for-format!-macros, r=Mark-Simulacrum 2022-03-10 23:12:57 +01:00
macros Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
mem Rollup merge of #88375 - joshlf:patch-3, r=dtolnay 2022-03-28 04:12:09 +02:00
num remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
ops Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
panic Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
prelude
ptr Auto merge of #94963 - lcnr:inherent-impls-std, r=oli-obk,m-ou-se 2022-03-30 12:28:50 +00:00
slice Auto merge of #94963 - lcnr:inherent-impls-std, r=oli-obk,m-ou-se 2022-03-30 12:28:50 +00:00
str remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
sync Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
task
unicode
any.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
ascii.rs Inline <EscapeDefault as Iterator>::next 2022-03-10 15:35:22 +01:00
bool.rs remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
borrow.rs
cell.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
clone.rs
cmp.rs Edit docs on consistency of PartialOrd and PartialEq 2022-03-04 13:31:32 -06:00
default.rs
hint.rs Add core::hint::must_use 2022-03-08 10:58:03 -08:00
internal_macros.rs Add a copy of cfg_if to core's internal_macros.rs 2022-03-01 16:24:10 -08:00
intrinsics.rs Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
lazy.rs
lib.rs rework implementation for inherent impls for builtin types 2022-03-30 11:23:58 +02:00
marker.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
option.rs Rollup merge of #94765 - m-ou-se:is-some-and, r=Dylan-DPC 2022-03-11 03:32:04 +01:00
panic.rs
panicking.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
pin.rs fix pin doc typo 2022-03-06 21:40:30 +08:00
primitive_docs.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
primitive.rs
result.rs Rollup merge of #94765 - m-ou-se:is-some-and, r=Dylan-DPC 2022-03-11 03:32:04 +01:00
time.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
tuple.rs
unit.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00