aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand')
-rw-r--r--crates/hir_expand/src/name.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
index b26ffa1ef..583ed6142 100644
--- a/crates/hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -38,7 +38,7 @@ impl Name {
38 } 38 }
39 39
40 pub fn new_lifetime(lt: &syntax::SyntaxToken) -> Name { 40 pub fn new_lifetime(lt: &syntax::SyntaxToken) -> Name {
41 assert!(lt.kind() == syntax::SyntaxKind::LIFETIME); 41 assert_eq!(lt.kind(), syntax::SyntaxKind::LIFETIME);
42 Name(Repr::Text(lt.text().clone())) 42 Name(Repr::Text(lt.text().clone()))
43 } 43 }
44 44
@@ -250,6 +250,8 @@ pub mod known {
250 pub const SELF_PARAM: super::Name = super::Name::new_inline("self"); 250 pub const SELF_PARAM: super::Name = super::Name::new_inline("self");
251 pub const SELF_TYPE: super::Name = super::Name::new_inline("Self"); 251 pub const SELF_TYPE: super::Name = super::Name::new_inline("Self");
252 252
253 pub const STATIC_LIFETIME: super::Name = super::Name::new_inline("'static");
254
253 #[macro_export] 255 #[macro_export]
254 macro_rules! name { 256 macro_rules! name {
255 (self) => { 257 (self) => {
@@ -258,6 +260,9 @@ pub mod known {
258 (Self) => { 260 (Self) => {
259 $crate::name::known::SELF_TYPE 261 $crate::name::known::SELF_TYPE
260 }; 262 };
263 ('static) => {
264 $crate::name::known::STATIC_LIFETIME
265 };
261 ($ident:ident) => { 266 ($ident:ident) => {
262 $crate::name::known::$ident 267 $crate::name::known::$ident
263 }; 268 };