Skip to content

Syntax: Fix mut in impl. #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RustEnhanced.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -728,15 +728,15 @@ contexts:
set: impl-body
- match: '(?=\bwhere\b)'
push: impl-where
- match: \b(mut|ref)\b
scope: storage.modifier.rust
- match: '{{identifier}}(?=<)'
scope: entity.name.impl.rust
push: generic-angles
- match: '{{identifier}}'
scope: entity.name.impl.rust
- match: '&'
scope: keyword.operator.rust
- match: \b(mut|ref)\b
scope: storage.modifier.rust
- match: '''{{identifier}}(?!\'')\b'
scope: storage.modifier.lifetime.rust

Expand Down
8 changes: 8 additions & 0 deletions syntax_test_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,3 +1203,11 @@ pub union Foo<'a, Y: Baz>
// that we don't accidentally interpret it as a keyword.
fn union() {}
// ^^^^^ meta.function entity.name.function

// Ensure that `mut` is a storage modifier.
impl<A> Thing for &'a mut A {}
// ^^^ meta.impl keyword.other
// ^ meta.impl keyword.operator
// ^^ meta.impl storage.modifier.lifetime
// ^^^ meta.impl storage.modifier
// ^ meta.impl entity.name.impl