File tree 2 files changed +3
-2
lines changed
compiler/rustc_hir_analysis/src/coherence
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ fn enforce_trait_manually_implementable(
43
43
let impl_header_span = tcx. def_span ( impl_def_id) ;
44
44
45
45
// Disallow *all* explicit impls of traits marked `#[rustc_deny_explicit_impl]`
46
- if tcx. trait_def ( trait_def_id) . deny_explicit_impl {
46
+ if tcx. trait_def ( trait_def_id) . deny_explicit_impl && !tcx . hir ( ) . rustc_coherence_is_core ( ) {
47
47
let trait_name = tcx. item_name ( trait_def_id) ;
48
48
let mut err = struct_span_err ! (
49
49
tcx. sess,
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ use crate::intrinsics;
112
112
// but we would likely want to indicate as such in documentation).
113
113
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
114
114
#[ cfg_attr( not( test) , rustc_diagnostic_item = "Any" ) ]
115
+ #[ cfg_attr( not( bootstrap) , rustc_deny_explicit_impl( implement_via_object = true ) ) ]
115
116
pub trait Any : ' static {
116
117
/// Gets the `TypeId` of `self`.
117
118
///
@@ -132,7 +133,7 @@ pub trait Any: 'static {
132
133
}
133
134
134
135
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
135
- impl < T : ' static + ? Sized > Any for T {
136
+ impl < T : ' static > Any for T {
136
137
fn type_id ( & self ) -> TypeId {
137
138
TypeId :: of :: < T > ( )
138
139
}
You can’t perform that action at this time.
0 commit comments