rust/library/std/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
..
backtrace
collections
env
error
f32
f64
ffi
fs Add a testcase. 2022-03-20 15:56:25 -07:00
io Auto merge of #95241 - Gankra:cleaned-provenance, r=workingjubilee 2022-03-30 10:09:10 +00:00
lazy
net
num
os fix unix typedef 2022-03-29 22:45:31 -04:00
panic
path Rollup merge of #94650 - ChrisDenton:windows-absolute-fix, r=dtolnay 2022-03-19 14:50:24 +01:00
prelude
process
sync Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
sys mark FIXMES for all the places found that are probably offset_from 2022-03-29 20:18:28 -04:00
sys_common Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
thread Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
time
alloc.rs
ascii.rs
backtrace.rs revert changes that cast functions to raw pointers, portability hazard 2022-03-29 20:18:27 -04:00
env.rs Link to std::io's platform-specific behavior disclaimer 2022-03-27 21:01:28 -07:00
error.rs
f32.rs remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
f64.rs remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
fs.rs Warn that platform-specific behavior may change 2022-03-29 19:49:15 -07:00
keyword_docs.rs
lazy.rs
lib.rs Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
macros.rs
num.rs
panic.rs
panicking.rs
path.rs Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
primitive_docs.rs
process.rs fix since field version for termination stabilization 2022-03-29 17:10:49 -07:00
rt.rs
time.rs Link to std::io's platform-specific behavior disclaimer 2022-03-27 21:01:28 -07:00