Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Grammars:

- fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][]
- enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][]
- enh(swift) add support for `distributed` keyword [Marcus Ortiz][]
- enh(xml) recognize Unicode letters instead of only ASCII letters in XML element and attribute names (#3256)[Martin Honnen][]
Expand Down
3 changes: 2 additions & 1 deletion src/languages/rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ export default function(hljs) {
begin: hljs.IDENT_RE + '::',
keywords: {
keyword: "Self",
built_in: BUILTINS
built_in: BUILTINS,
type: TYPES
}
},
{
Expand Down
3 changes: 3 additions & 0 deletions test/markup/rust/types.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
<span class="hljs-keyword">type</span> <span class="hljs-title class_">A</span>;
<span class="hljs-keyword">type</span> <span class="hljs-title class_">A</span> = B;
<span class="hljs-keyword">type</span> <span class="hljs-title class_">R</span>&lt;T&gt; = m::R&lt;T, ConcreteError&gt;

<span class="hljs-keyword">let</span> <span class="hljs-variable">vec</span>: <span class="hljs-type">Vec</span>&lt;<span class="hljs-type">isize</span>&gt; = <span class="hljs-type">Vec</span>::<span class="hljs-title function_ invoke__">new</span>();
<span class="hljs-keyword">if</span> <span class="hljs-number">100</span> &gt; <span class="hljs-type">i32</span>::MAX {}
3 changes: 3 additions & 0 deletions test/markup/rust/types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ type A: Trait;
type A;
type A = B;
type R<T> = m::R<T, ConcreteError>

let vec: Vec<isize> = Vec::new();
if 100 > i32::MAX {}