diff options
-rw-r--r-- | pygments/lexers/rust.py | 2 | ||||
-rw-r--r-- | tests/examplefiles/rust_example.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pygments/lexers/rust.py b/pygments/lexers/rust.py index 87bdcc5e..b4acbbd1 100644 --- a/pygments/lexers/rust.py +++ b/pygments/lexers/rust.py @@ -112,7 +112,7 @@ class RustLexer(RegexLexer): (r'[a-zA-Z_]\w*', Name), # Attributes - (r'#\[', Comment.Preproc, 'attribute['), + (r'#!?\[', Comment.Preproc, 'attribute['), # Macros (r'([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\s*)(\{)', bygroups(Comment.Preproc, Punctuation, Whitespace, Name, diff --git a/tests/examplefiles/rust_example.rs b/tests/examplefiles/rust_example.rs index 8ffbaf6b..8c44af1d 100644 --- a/tests/examplefiles/rust_example.rs +++ b/tests/examplefiles/rust_example.rs @@ -24,7 +24,7 @@ use core::os; // an llvm intrinsic. #[nolink] extern mod libc { - #[legacy_exports]; + #![legacy_exports]; fn sqrt(n: float) -> float; } |