Skip to content

Commit bafe869

Browse files
bors[bot]ehuss
andcommitted
Merge #325
325: Syntax: Support *const raw pointer in (some) type positions. r=ehuss a=ehuss This doesn't handle everything (like `let x: *const u8 = ...`), but that's a whole other can of worms. <img width="583" alt="image" src="https://user-images.githubusercontent.com/43198/43736162-87f4041c-9971-11e8-9f6d-099bbb1fea3b.png"> Co-authored-by: Eric Huss <[email protected]>
2 parents e30bd89 + 6b2ee4c commit bafe869

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

RustEnhanced.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ contexts:
478478
- include: return-type
479479
- match: '&'
480480
scope: keyword.operator.rust
481-
- match: \b(mut|ref)\b
481+
- match: \b(mut|ref|const)\b
482482
scope: storage.modifier.rust
483483
- match: \b(fn)\b(\()
484484
captures:

tests/syntax-rust/syntax_test_functions.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ let f: extern "C" fn () = mem::transmute(0xffff0fa0u32);
6666
// ^ keyword.operator
6767
// ^^^^^^^^^^ meta.group constant.numeric.integer.hexadecimal
6868
// ^^^ meta.group storage.type.numeric
69+
70+
// Raw pointer in a parameter.
71+
fn f(a: *const u8, b: *mut i8) {}
72+
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function
73+
// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters
74+
// ^^^^^ storage.modifier
75+
// ^^^ storage.modifier

0 commit comments

Comments
 (0)