From 1cd78a3355ea70d3070cabb00c80a5d195499752 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 31 May 2020 10:59:40 +0200 Subject: correctly infer labelled breaks --- crates/ra_hir_expand/src/name.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/ra_hir_expand') diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs index fecce224e..ea495cb11 100644 --- a/crates/ra_hir_expand/src/name.rs +++ b/crates/ra_hir_expand/src/name.rs @@ -37,6 +37,11 @@ impl Name { Name(Repr::TupleField(idx)) } + pub fn new_lifetime(lt: &ra_syntax::SyntaxToken) -> Name { + assert!(lt.kind() == ra_syntax::SyntaxKind::LIFETIME); + Name(Repr::Text(lt.text().clone())) + } + /// Shortcut to create inline plain text name const fn new_inline_ascii(text: &[u8]) -> Name { Name::new_text(SmolStr::new_inline_from_ascii(text.len(), text)) -- cgit v1.2.3