about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-03-22 14:45:32 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-04-04 08:29:06 +0300
commit8ad149a0e0810cb2ef17b2b0aef18c9a2a9062b0 (patch)
treeb00340d617620bc1e727f5b525936d94e24d225c
parentea7999b4f3511c2fda3c7c8955b6d03573868139 (diff)
downloadrust-8ad149a0e0810cb2ef17b2b0aef18c9a2a9062b0.tar.gz
rust-8ad149a0e0810cb2ef17b2b0aef18c9a2a9062b0.zip
typeck/type_of: only early-bound and (free) late-bound lifetimes are parameters.
-rw-r--r--src/librustc_typeck/collect/type_of.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_typeck/collect/type_of.rs b/src/librustc_typeck/collect/type_of.rs
index c2a32ffe482..d45c8270068 100644
--- a/src/librustc_typeck/collect/type_of.rs
+++ b/src/librustc_typeck/collect/type_of.rs
@@ -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(_)),
                     };