diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-31 13:03:24 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-31 13:03:24 +0100 |
commit | 5579ba8af5a31591a16b8f0f43053f73d07fb8b8 (patch) | |
tree | 2a0f7e55e01edc9edb2c49c3a94d07da172b1b40 /crates/ra_hir_expand | |
parent | d7071eae2cb78547b8345d4c6ba2731a5151c049 (diff) | |
parent | cc6ba84c400417af873462364ba5cd4f6b5ab1f6 (diff) |
Merge #4667
4667: Infer labelled breaks correctly r=flodiebold a=robojumper
Fixes #4663.
Co-authored-by: robojumper <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/name.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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 { | |||
37 | Name(Repr::TupleField(idx)) | 37 | Name(Repr::TupleField(idx)) |
38 | } | 38 | } |
39 | 39 | ||
40 | pub fn new_lifetime(lt: &ra_syntax::SyntaxToken) -> Name { | ||
41 | assert!(lt.kind() == ra_syntax::SyntaxKind::LIFETIME); | ||
42 | Name(Repr::Text(lt.text().clone())) | ||
43 | } | ||
44 | |||
40 | /// Shortcut to create inline plain text name | 45 | /// Shortcut to create inline plain text name |
41 | const fn new_inline_ascii(text: &[u8]) -> Name { | 46 | const fn new_inline_ascii(text: &[u8]) -> Name { |
42 | Name::new_text(SmolStr::new_inline_from_ascii(text.len(), text)) | 47 | Name::new_text(SmolStr::new_inline_from_ascii(text.len(), text)) |