aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-04-06 09:50:55 +0100
committerLukas Wirth <[email protected]>2021-04-06 09:50:55 +0100
commit08dc69599efb4961319c0118b789d3abb264b7fa (patch)
treef4951c835dd6f4840ae02ba5c06d5da44aedae94 /crates/hir_ty/src/traits
parentb98c681cb7ede9fd6a8683b1edd83a5b18502178 (diff)
Use a constructor function for Static lifetimes
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 128ec166a..9267e32b5 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -3,16 +3,16 @@
3//! Chalk (in both directions); plus some helper functions for more specialized 3//! Chalk (in both directions); plus some helper functions for more specialized
4//! conversions. 4//! conversions.
5 5
6use chalk_ir::{cast::Cast, interner::HasInterner, LifetimeData}; 6use chalk_ir::{cast::Cast, interner::HasInterner};
7use chalk_solve::rust_ir; 7use chalk_solve::rust_ir;
8 8
9use base_db::salsa::InternKey; 9use base_db::salsa::InternKey;
10use hir_def::{GenericDefId, TypeAliasId}; 10use hir_def::{GenericDefId, TypeAliasId};
11 11
12use crate::{ 12use crate::{
13 chalk_ext::ProjectionTyExt, db::HirDatabase, primitive::UintTy, AliasTy, CallableDefId, 13 chalk_ext::ProjectionTyExt, db::HirDatabase, primitive::UintTy, static_lifetime, AliasTy,
14 Canonical, DomainGoal, FnPointer, GenericArg, InEnvironment, Lifetime, OpaqueTy, ProjectionTy, 14 CallableDefId, Canonical, DomainGoal, FnPointer, GenericArg, InEnvironment, Lifetime, OpaqueTy,
15 QuantifiedWhereClause, Scalar, Substitution, TraitRef, Ty, TypeWalk, WhereClause, 15 ProjectionTy, QuantifiedWhereClause, Scalar, Substitution, TraitRef, Ty, TypeWalk, WhereClause,
16}; 16};
17 17
18use super::interner::*; 18use super::interner::*;
@@ -100,7 +100,7 @@ impl ToChalk for Ty {
100 ); 100 );
101 let bounded_ty = chalk_ir::DynTy { 101 let bounded_ty = chalk_ir::DynTy {
102 bounds: chalk_ir::Binders::new(binders, where_clauses), 102 bounds: chalk_ir::Binders::new(binders, where_clauses),
103 lifetime: LifetimeData::Static.intern(&Interner), 103 lifetime: static_lifetime(),
104 }; 104 };
105 chalk_ir::TyKind::Dyn(bounded_ty).intern(&Interner) 105 chalk_ir::TyKind::Dyn(bounded_ty).intern(&Interner)
106 } 106 }
@@ -149,7 +149,7 @@ impl ToChalk for Ty {
149 where_clauses.bounds.binders.clone(), 149 where_clauses.bounds.binders.clone(),
150 crate::QuantifiedWhereClauses::from_iter(&Interner, bounds), 150 crate::QuantifiedWhereClauses::from_iter(&Interner, bounds),
151 ), 151 ),
152 lifetime: LifetimeData::Static.intern(&Interner), 152 lifetime: static_lifetime(),
153 }) 153 })
154 } 154 }
155 155
@@ -197,7 +197,7 @@ fn ref_to_chalk(
197 ty: Ty, 197 ty: Ty,
198) -> chalk_ir::Ty<Interner> { 198) -> chalk_ir::Ty<Interner> {
199 let arg = ty.to_chalk(db); 199 let arg = ty.to_chalk(db);
200 let lifetime = LifetimeData::Static.intern(&Interner); 200 let lifetime = static_lifetime();
201 chalk_ir::TyKind::Ref(mutability, lifetime, arg).intern(&Interner) 201 chalk_ir::TyKind::Ref(mutability, lifetime, arg).intern(&Interner)
202} 202}
203 203