@@ -54,7 +54,7 @@ syn keyword rustUnsafeKeyword unsafe
54
54
syn keyword rustKeyword use nextgroup =rustModPath skipempty skipwhite
55
55
" FIXME: Scoped impl's name is also fallen in this category
56
56
syn keyword rustKeyword mod trait nextgroup =rustType skipempty skipwhite
57
- syn keyword rustStorage move mut ref static const nextgroup =@rustIdentifiers skipempty skipwhite
57
+ syn keyword rustStorage move mut ref static const nextgroup =rustStorage, @rustIdentifiers skipempty skipwhite
58
58
syn match rustDefault / \< default\z e\_ s\+\( impl\| fn\| type\| const\)\> / display
59
59
syn keyword rustAwait await nextgroup =@rustIdentifiers skipempty skipwhite
60
60
syn match rustKeyword / \< try\> !\@ !/ display
@@ -71,7 +71,7 @@ syn match rustIdentifier "\<\l\+\(_\l\+\)*\((\)\@!\>" contained contains=rustBo
71
71
syn match rustType " \<\(\u\l *\)\+\( (\)\@ !\> " contains =rustTypePrime contained display
72
72
syn match rustConstant " \<\u\+\( _\u\+\) *\( (\)\@ !\> " contained display
73
73
syn match rustFuncName " \<\w\+\( ::\)\?\( <.*>\)\?\s *\( (\)\@ =\> " contains =rustEnumVariant,rustModPathSep,rustGenericRegion display
74
- syn cluster rustIdentifiers contains =rustLifetime ,rustModPath,rustBuiltinType,rustEnum,rustTrait,rustEnumVariant,rustMacro,rustFuncName,rustConstant,rustIdentifier,rustType
74
+ syn cluster rustIdentifiers contains =@rustLifetimes ,rustModPath,rustBuiltinType,rustEnum,rustTrait,rustEnumVariant,rustMacro,rustFuncName,rustConstant,rustIdentifier,rustType
75
75
76
76
syn region rustMacroRepeat matchgroup =rustMacroRepeatDelimiters start =" $(" end =" ),\= [*+]" contains =TOP
77
77
syn match rustMacroVariable " \$\w\+ " display
@@ -201,8 +201,10 @@ syn match rustFloat "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\
201
201
202
202
" rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
203
203
syn match rustLifetime " \'\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display nextgroup =rustNoise,@rustIdentifiers skipempty skipwhite
204
- syn match rustLabel " \'\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *:" display
205
- syn match rustLabel " \% (\<\% (break\| continue\)\s *\)\@ <=\'\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display
204
+ syn match rustStaticLifetime " 'static" display contains =rustStorage nextgroup =rustNoise,@rustIdentifiers skipempty skipwhite
205
+ syn cluster rustLifetimes contains =rustStaticLifetime,rustLifetime
206
+ syn match rustLabel " \'\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *:" contains =rustBounds display
207
+ syn match rustLabel " \% (\<\% (break\| continue\)\s *\)\@ <=\'\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display
206
208
syn match rustCharacterInvalid / b\? '\z s[\n\r\t ']\z e'/ contained
207
209
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
208
210
syn match rustCharacterInvalidUnicode / b'\z s[^[:cntrl:][:graph:][:alnum:][:space:]]\z e'/ contained display
@@ -364,7 +366,8 @@ hi def link rustDerive PreProc
364
366
hi def link rustDefault StorageClass
365
367
hi def link rustStorage StorageClass
366
368
hi def link rustObsoleteStorage Error
367
- hi def link rustLifetime Special
369
+ hi def link rustLifetime Special
370
+ hi def link rustStaticLifetime rustStorage
368
371
hi def link rustLabel Label
369
372
hi def link rustExternCrate rustKeyword
370
373
hi def link rustObsoleteExternMod Error
0 commit comments