Skip to content

Commit 159cffa

Browse files
bors[bot]ehuss
andcommitted
Merge #366
366: Syntax: Fix lifetime for `self` in method. r=ehuss a=ehuss <img width="148" alt="image" src="https://user-images.githubusercontent.com/43198/51508309-7e784300-1da9-11e9-896c-d4b1627e9a85.png"> Co-authored-by: Eric Huss <[email protected]>
2 parents d58fe85 + d064ca9 commit 159cffa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

RustEnhanced.sublime-syntax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ contexts:
324324
scope: storage.modifier.rust
325325
- match: '@'
326326
scope: keyword.operator.rust
327+
- include: lifetime
327328
- match: '\b{{identifier}}\b(?!\s*(?:::|\{|\[|\())'
328329
scope: variable.parameter.rust
329330

tests/syntax-rust/syntax_test_functions.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,9 @@ const extern "C" fn f() {}
124124
// ^^^ string.quoted.double
125125
// ^^ meta.function storage.type.function
126126
// ^ meta.function entity.name.function
127+
128+
fn foo(&'a self) {}
129+
// ^^^^^^^^ meta.function meta.function.parameters
130+
// ^ keyword.operator
131+
// ^^ storage.modifier.lifetime
132+
// ^^^^ variable.parameter

0 commit comments

Comments
 (0)