1
Fork 0

Rollup merge of #118915 - compiler-errors:alias-nits, r=lcnr

Add some comments, add `can_define_opaque_ty` check to `try_normalize_ty_recur`

Follow-up from #117278, since I was recently re-reviewing this code.
This commit is contained in:
Matthias Krüger 2024-01-11 03:02:39 +01:00 committed by GitHub
commit 859874f3eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 65 additions and 45 deletions

View file

@ -315,7 +315,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
let mut failed = false;
let elaborated_args = std::iter::zip(*args, &generics.params).map(|(arg, param)| {
if let Some(ty::Dynamic(obj, _, ty::DynKind::Dyn)) = arg.as_type().map(Ty::kind) {
if let Some(ty::Dynamic(obj, _, ty::Dyn)) = arg.as_type().map(Ty::kind) {
let default = tcx.object_lifetime_default(param.def_id);
let re_static = tcx.lifetimes.re_static;
@ -339,7 +339,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
has_dyn = true;
Ty::new_dynamic(tcx, obj, implied_region, ty::DynKind::Dyn).into()
Ty::new_dynamic(tcx, obj, implied_region, ty::Dyn).into()
} else {
arg
}