1
Fork 0

library: Move CStr to libcore, and CString to liballoc

This commit is contained in:
Vadim Petrochenkov 2022-02-16 19:23:37 +08:00
parent e7575f9670
commit 5bee741a08
21 changed files with 941 additions and 675 deletions

View file

@ -644,7 +644,11 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
self.assemble_inherent_impl_candidates_for_type(p.def_id());
}
ty::Adt(def, _) => {
self.assemble_inherent_impl_candidates_for_type(def.did());
let def_id = def.did();
self.assemble_inherent_impl_candidates_for_type(def_id);
if Some(def_id) == self.tcx.lang_items().c_str() {
self.assemble_inherent_candidates_for_incoherent_ty(raw_self_ty);
}
}
ty::Foreign(did) => {
self.assemble_inherent_impl_candidates_for_type(did);

View file

@ -55,7 +55,12 @@ impl<'tcx> ItemLikeVisitor<'_> for InherentCollect<'tcx> {
let self_ty = self.tcx.type_of(item.def_id);
match *self_ty.kind() {
ty::Adt(def, _) => {
self.check_def_id(item, def.did());
let def_id = def.did();
if !def_id.is_local() && Some(def_id) == self.tcx.lang_items().c_str() {
self.check_primitive_impl(item.def_id, self_ty, items, ty.span)
} else {
self.check_def_id(item, def_id);
}
}
ty::Foreign(did) => {
self.check_def_id(item, did);