diff options
author | Lukas Wirth <[email protected]> | 2021-06-15 20:44:07 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-06-15 20:49:59 +0100 |
commit | 29054e02fbc7a858d9d4a6efd61583ac45b3213b (patch) | |
tree | 87d55a0ef8df2c6263722ea3899c4e45c11173db /crates/ide/src/syntax_highlighting/test_data | |
parent | 7f482afada7519e828b8dbe8fafe063885256516 (diff) |
Highlight unsafe trait refs as unsafe only in impl blocks and definitions
Diffstat (limited to 'crates/ide/src/syntax_highlighting/test_data')
9 files changed, 14 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html b/crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html index a0ea1db34..4e85f7c0b 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html index 921a956e6..79a285107 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_extern_crate.html b/crates/ide/src/syntax_highlighting/test_data/highlight_extern_crate.html index ca9bb1e7d..13f589cc0 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_extern_crate.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_extern_crate.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html b/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html index 6202a03ce..50df376ae 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html index e860d713e..96cb09642 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html b/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html index 68165bdbf..55453468b 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
@@ -61,6 +62,11 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
61 | <span class="field declaration">a</span><span class="colon">:</span> <span class="builtin_type">u16</span><span class="comma">,</span> | 62 | <span class="field declaration">a</span><span class="colon">:</span> <span class="builtin_type">u16</span><span class="comma">,</span> |
62 | <span class="brace">}</span> | 63 | <span class="brace">}</span> |
63 | 64 | ||
65 | <span class="keyword unsafe">unsafe</span> <span class="keyword">trait</span> <span class="trait declaration unsafe">UnsafeTrait</span> <span class="brace">{</span><span class="brace">}</span> | ||
66 | <span class="keyword unsafe">unsafe</span> <span class="keyword">impl</span> <span class="trait unsafe">UnsafeTrait</span> <span class="keyword">for</span> <span class="struct">Packed</span> <span class="brace">{</span><span class="brace">}</span> | ||
67 | |||
68 | <span class="keyword">fn</span> <span class="function declaration">require_unsafe_trait</span><span class="angle"><</span><span class="type_param declaration">T</span><span class="colon">:</span> <span class="trait">UnsafeTrait</span><span class="angle">></span><span class="parenthesis">(</span><span class="punctuation">_</span><span class="colon">:</span> <span class="type_param">T</span><span class="parenthesis">)</span> <span class="brace">{</span><span class="brace">}</span> | ||
69 | |||
64 | <span class="keyword">trait</span> <span class="trait declaration">DoTheAutoref</span> <span class="brace">{</span> | 70 | <span class="keyword">trait</span> <span class="trait declaration">DoTheAutoref</span> <span class="brace">{</span> |
65 | <span class="keyword">fn</span> <span class="function associated declaration trait">calls_autoref</span><span class="parenthesis">(</span><span class="operator">&</span><span class="self_keyword declaration">self</span><span class="parenthesis">)</span><span class="semicolon">;</span> | 71 | <span class="keyword">fn</span> <span class="function associated declaration trait">calls_autoref</span><span class="parenthesis">(</span><span class="operator">&</span><span class="self_keyword declaration">self</span><span class="parenthesis">)</span><span class="semicolon">;</span> |
66 | <span class="brace">}</span> | 72 | <span class="brace">}</span> |
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html index 59f1e8e4c..9232cf905 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
diff --git a/crates/ide/src/syntax_highlighting/test_data/injection.html b/crates/ide/src/syntax_highlighting/test_data/injection.html index 9ab46d05c..082837328 100644 --- a/crates/ide/src/syntax_highlighting/test_data/injection.html +++ b/crates/ide/src/syntax_highlighting/test_data/injection.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |
diff --git a/crates/ide/src/syntax_highlighting/test_data/rainbow_highlighting.html b/crates/ide/src/syntax_highlighting/test_data/rainbow_highlighting.html index 666b0b228..763917714 100644 --- a/crates/ide/src/syntax_highlighting/test_data/rainbow_highlighting.html +++ b/crates/ide/src/syntax_highlighting/test_data/rainbow_highlighting.html | |||
@@ -15,6 +15,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
15 | .field { color: #94BFF3; } | 15 | .field { color: #94BFF3; } |
16 | .function { color: #93E0E3; } | 16 | .function { color: #93E0E3; } |
17 | .function.unsafe { color: #BC8383; } | 17 | .function.unsafe { color: #BC8383; } |
18 | .trait.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | 19 | .operator.unsafe { color: #BC8383; } |
19 | .parameter { color: #94BFF3; } | 20 | .parameter { color: #94BFF3; } |
20 | .text { color: #DCDCCC; } | 21 | .text { color: #DCDCCC; } |