summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/compiled.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 25c7a4d8..8bfa6058 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -3321,7 +3321,7 @@ class RustLexer(RegexLexer):
(r'\s+', Text),
(r'//[/!](.*?)\n', Comment.Doc),
(r'//(.*?)\n', Comment.Single),
- (r'/[*](.|\n)*?[*]/', Comment.Multiline),
+ (r'/\*', Comment.Multiline, 'comment'),
# Keywords
(r'(as|box|break|continue'
@@ -3403,6 +3403,12 @@ class RustLexer(RegexLexer):
(r'([A-Za-z_]\w*)!\s*([A-Za-z_]\w*)?\(',
bygroups(Comment.Preproc, Name), 'macro('),
],
+ 'comment': [
+ (r'[^*/]+', Comment.Multiline),
+ (r'/\*', Comment.Multiline, '#push'),
+ (r'\*/', Comment.Multiline, '#pop'),
+ (r'[*/]', Comment.Multiline),
+ ],
'number_lit': [
(r'(([ui](8|16|32|64)?)|(f(32|64)?))?', Keyword, '#pop'),
],