Skip to content

Commit

Permalink
typeck/type_of: only early-bound and (free) late-bound lifetimes are …
Browse files Browse the repository at this point in the history
…parameters.
  • Loading branch information
eddyb committed Apr 4, 2020
1 parent ea7999b commit 8ad149a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_typeck/collect/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
for (i, arg) in substs.iter().enumerate() {
let arg_is_param = match arg.unpack() {
GenericArgKind::Type(ty) => matches!(ty.kind, ty::Param(_)),
GenericArgKind::Lifetime(lt) => !matches!(lt, ty::ReStatic),
GenericArgKind::Lifetime(lt) => {
matches!(lt, ty::ReEarlyBound(_) | ty::ReFree(_))
}
GenericArgKind::Const(ct) => matches!(ct.val, ty::ConstKind::Param(_)),
};

Expand Down

0 comments on commit 8ad149a

Please sign in to comment.