Skip to content

Commit 6d44c1e

Browse files
committed
Syntax: Fix mut in impl.
1 parent 18edc8a commit 6d44c1e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

RustEnhanced.sublime-syntax

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,15 +728,15 @@ contexts:
728728
set: impl-body
729729
- match: '(?=\bwhere\b)'
730730
push: impl-where
731+
- match: \b(mut|ref)\b
732+
scope: storage.modifier.rust
731733
- match: '{{identifier}}(?=<)'
732734
scope: entity.name.impl.rust
733735
push: generic-angles
734736
- match: '{{identifier}}'
735737
scope: entity.name.impl.rust
736738
- match: '&'
737739
scope: keyword.operator.rust
738-
- match: \b(mut|ref)\b
739-
scope: storage.modifier.rust
740740
- match: '''{{identifier}}(?!\'')\b'
741741
scope: storage.modifier.lifetime.rust
742742

syntax_test_rust.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,3 +1203,11 @@ pub union Foo<'a, Y: Baz>
12031203
// that we don't accidentally interpret it as a keyword.
12041204
fn union() {}
12051205
// ^^^^^ meta.function entity.name.function
1206+
1207+
// Ensure that `mut` is a storage modifier.
1208+
impl<A> Thing for &'a mut A {}
1209+
// ^^^ meta.impl keyword.other
1210+
// ^ meta.impl keyword.operator
1211+
// ^^ meta.impl storage.modifier.lifetime
1212+
// ^^^ meta.impl storage.modifier
1213+
// ^ meta.impl entity.name.impl

0 commit comments

Comments
 (0)