Store impl unsafety in impl trait header
This commit is contained in:
parent
09d73fab08
commit
11a73f6d4d
4 changed files with 28 additions and 24 deletions
|
@ -132,12 +132,12 @@ fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) -> Result<(), ErrorGuaranteed>
|
|||
let mut res = tcx.ensure().specialization_graph_of(def_id);
|
||||
|
||||
for &impl_def_id in impls {
|
||||
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap().instantiate_identity();
|
||||
let trait_header = tcx.impl_trait_header(impl_def_id).unwrap().instantiate_identity();
|
||||
|
||||
res = res.and(check_impl(tcx, impl_def_id, trait_ref));
|
||||
res = res.and(check_object_overlap(tcx, impl_def_id, trait_ref));
|
||||
res = res.and(check_impl(tcx, impl_def_id, trait_header.trait_ref));
|
||||
res = res.and(check_object_overlap(tcx, impl_def_id, trait_header.trait_ref));
|
||||
|
||||
res = res.and(unsafety::check_item(tcx, impl_def_id, trait_ref));
|
||||
res = res.and(unsafety::check_item(tcx, impl_def_id, trait_header));
|
||||
res = res.and(tcx.ensure().orphan_check_impl(impl_def_id));
|
||||
res = res.and(builtin::check_trait(tcx, def_id, impl_def_id));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue