rust/compiler/rustc_hir/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
..
arena.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
def_path_hash_map.rs Use on-disk-hash-table format for DefPathHashMap in hir::definitions. 2021-09-14 13:54:41 +02:00
def.rs Make node_id_to_hir_id owner-local. 2022-02-20 10:17:27 -03:00
definitions.rs Spellchecking compiler code 2022-03-30 01:42:10 -04:00
diagnostic_items.rs Introduce get_diagnostic_name 2021-10-06 08:40:28 -05:00
hir_id.rs add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
hir.rs Spellchecking some comments 2022-03-30 01:39:38 -04:00
intravisit.rs resolve: Fix incorrect results of opt_def_kind query for some built-in macros 2022-02-24 22:54:36 +03:00
itemlikevisit.rs fix mention of moved function in rustc_hir docs 2022-02-11 15:38:31 +00:00
lang_items.rs remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
lib.rs add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
pat_util.rs Simplify for loop desugar 2021-11-21 08:15:21 -06:00
stable_hash_impls.rs Rollup merge of #93443 - spastorino:add-stable-hash-impl-doc, r=cjgillot 2022-02-11 07:48:03 +01:00
target.rs Give more details in Display for hir::Target 2022-03-19 02:03:37 -07:00
tests.rs Revert "Revert "Fix test"" 2021-07-06 11:28:06 +02:00
weak_lang_items.rs Clean up lang_items::extract 2022-01-09 13:41:04 -08:00