Skip to content

Commit dc0a603

Browse files
committed
Syntax: Fix unsafe prefix for function types.
1 parent 5f995e8 commit dc0a603

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

RustEnhanced.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ contexts:
472472
- include: return-type
473473
- match: '&'
474474
scope: keyword.operator.rust
475-
- match: \b(mut|ref|const)\b
475+
- match: \b(mut|ref|const|unsafe)\b
476476
scope: storage.modifier.rust
477477
- match: \b(fn)\b(\()
478478
captures:

tests/syntax-rust/syntax_test_misc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ unsafe impl<T> Send for Interned<T> {}
99
//^^^^ storage.modifier
1010
pub unsafe trait Alloc { }
1111
// ^^^^^^ storage.modifier
12+
fn f(a: unsafe fn() -> String) {}
13+
// ^^^^^^ meta.function meta.function.parameters storage.modifier
14+
// ^^ meta.function meta.function.parameters storage.type.function
1215

1316
// Previously reserved keywords now unreserved.
1417
let pure = 1;

0 commit comments

Comments
 (0)