Skip to content

Commit 8ad149a

Browse files
committed
typeck/type_of: only early-bound and (free) late-bound lifetimes are parameters.
1 parent ea7999b commit 8ad149a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_typeck/collect/type_of.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
411411
for (i, arg) in substs.iter().enumerate() {
412412
let arg_is_param = match arg.unpack() {
413413
GenericArgKind::Type(ty) => matches!(ty.kind, ty::Param(_)),
414-
GenericArgKind::Lifetime(lt) => !matches!(lt, ty::ReStatic),
414+
GenericArgKind::Lifetime(lt) => {
415+
matches!(lt, ty::ReEarlyBound(_) | ty::ReFree(_))
416+
}
415417
GenericArgKind::Const(ct) => matches!(ct.val, ty::ConstKind::Param(_)),
416418
};
417419

0 commit comments

Comments
 (0)