rust/library/alloc/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 Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
collections rename internal helper trait AsIntoIter to AsVecIntoIter 2022-03-22 00:02:54 +01:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
sync Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
vec Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
alloc.rs Rename ~const Drop to ~const Destruct 2022-03-21 17:04:03 +11:00
borrow.rs Rename ~const Drop to ~const Destruct 2022-03-21 17:04:03 +11:00
boxed.rs Rename ~const Drop to ~const Destruct 2022-03-21 17:04:03 +11:00
fmt.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
lib.rs fixup feature position in liballoc 2022-03-29 20:18:29 -04:00
macros.rs Add diagnostic items for macros 2022-01-06 14:59:33 +00:00
raw_vec.rs Fix typo 2022-02-12 12:31:33 +01:00
rc.rs Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
slice.rs Auto merge of #94963 - lcnr:inherent-impls-std, r=oli-obk,m-ou-se 2022-03-30 12:28:50 +00:00
str.rs remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
string.rs Rollup merge of #95368 - lopopolo:lopopolo/string-try-reserve-exact-doc-typo, r=Dylan-DPC 2022-03-27 22:51:42 +02:00
sync.rs Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00