Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors
Avoid calling report_forbidden_specialization for RPITITs Fixes #113438 r? ``@compiler-errors``
This commit is contained in:
commit
cf1f8c55d5
4 changed files with 94 additions and 2 deletions
|
@ -722,7 +722,14 @@ pub(super) fn check_specialization_validity<'tcx>(
|
|||
let result = opt_result.unwrap_or(Ok(()));
|
||||
|
||||
if let Err(parent_impl) = result {
|
||||
report_forbidden_specialization(tcx, impl_item, parent_impl);
|
||||
if !tcx.is_impl_trait_in_trait(impl_item) {
|
||||
report_forbidden_specialization(tcx, impl_item, parent_impl);
|
||||
} else {
|
||||
tcx.sess.delay_span_bug(
|
||||
DUMMY_SP,
|
||||
format!("parent item: {:?} not marked as default", parent_impl),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1485,7 +1492,9 @@ fn opaque_type_cycle_error(
|
|||
}
|
||||
|
||||
for closure_def_id in visitor.closures {
|
||||
let Some(closure_local_did) = closure_def_id.as_local() else { continue; };
|
||||
let Some(closure_local_did) = closure_def_id.as_local() else {
|
||||
continue;
|
||||
};
|
||||
let typeck_results = tcx.typeck(closure_local_did);
|
||||
|
||||
let mut label_match = |ty: Ty<'_>, span| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue