Better unsafe highlihgting tests

This commit is contained in:
Aleksey Kladov 2020-06-08 15:23:03 +02:00
parent c476f71bdf
commit 3b4d000250
8 changed files with 16 additions and 9 deletions

View file

@ -10,7 +10,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.string_literal { color: #CC9393; } .string_literal { color: #CC9393; }
.field { color: #94BFF3; } .field { color: #94BFF3; }
.function { color: #93E0E3; } .function { color: #93E0E3; }
.operator.unsafe { color: #E28C14; } .function.unsafe { color: #BC8383; }
.operator.unsafe { color: #BC8383; }
.parameter { color: #94BFF3; } .parameter { color: #94BFF3; }
.text { color: #DCDCCC; } .text { color: #DCDCCC; }
.type { color: #7CB8BB; } .type { color: #7CB8BB; }

View file

@ -10,7 +10,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.string_literal { color: #CC9393; } .string_literal { color: #CC9393; }
.field { color: #94BFF3; } .field { color: #94BFF3; }
.function { color: #93E0E3; } .function { color: #93E0E3; }
.operator.unsafe { color: #E28C14; } .function.unsafe { color: #BC8383; }
.operator.unsafe { color: #BC8383; }
.parameter { color: #94BFF3; } .parameter { color: #94BFF3; }
.text { color: #DCDCCC; } .text { color: #DCDCCC; }
.type { color: #7CB8BB; } .type { color: #7CB8BB; }

View file

@ -10,7 +10,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.string_literal { color: #CC9393; } .string_literal { color: #CC9393; }
.field { color: #94BFF3; } .field { color: #94BFF3; }
.function { color: #93E0E3; } .function { color: #93E0E3; }
.operator.unsafe { color: #E28C14; } .function.unsafe { color: #BC8383; }
.operator.unsafe { color: #BC8383; }
.parameter { color: #94BFF3; } .parameter { color: #94BFF3; }
.text { color: #DCDCCC; } .text { color: #DCDCCC; }
.type { color: #7CB8BB; } .type { color: #7CB8BB; }

View file

@ -10,7 +10,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.string_literal { color: #CC9393; } .string_literal { color: #CC9393; }
.field { color: #94BFF3; } .field { color: #94BFF3; }
.function { color: #93E0E3; } .function { color: #93E0E3; }
.operator.unsafe { color: #E28C14; } .function.unsafe { color: #BC8383; }
.operator.unsafe { color: #BC8383; }
.parameter { color: #94BFF3; } .parameter { color: #94BFF3; }
.text { color: #DCDCCC; } .text { color: #DCDCCC; }
.type { color: #7CB8BB; } .type { color: #7CB8BB; }
@ -42,7 +43,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
<span class="keyword unsafe">unsafe</span> { <span class="keyword unsafe">unsafe</span> {
<span class="function unsafe">unsafe_fn</span>(); <span class="function unsafe">unsafe_fn</span>();
<span class="struct">HasUnsafeFn</span>.<span class="function unsafe">unsafe_method</span>(); <span class="struct">HasUnsafeFn</span>.<span class="function unsafe">unsafe_method</span>();
<span class="keyword">let</span> <span class="variable declaration">y</span> = <span class="operator unsafe">*</span><span class="variable">x</span>; <span class="keyword">let</span> <span class="variable declaration">y</span> = <span class="operator unsafe">*</span>(<span class="variable">x</span>);
<span class="keyword">let</span> <span class="variable declaration">z</span> = -<span class="variable">x</span>; <span class="keyword">let</span> <span class="variable declaration">z</span> = -<span class="variable">x</span>;
} }
}</code></pre> }</code></pre>

View file

@ -10,7 +10,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.string_literal { color: #CC9393; } .string_literal { color: #CC9393; }
.field { color: #94BFF3; } .field { color: #94BFF3; }
.function { color: #93E0E3; } .function { color: #93E0E3; }
.operator.unsafe { color: #E28C14; } .function.unsafe { color: #BC8383; }
.operator.unsafe { color: #BC8383; }
.parameter { color: #94BFF3; } .parameter { color: #94BFF3; }
.text { color: #DCDCCC; } .text { color: #DCDCCC; }
.type { color: #7CB8BB; } .type { color: #7CB8BB; }

View file

@ -10,7 +10,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.string_literal { color: #CC9393; } .string_literal { color: #CC9393; }
.field { color: #94BFF3; } .field { color: #94BFF3; }
.function { color: #93E0E3; } .function { color: #93E0E3; }
.operator.unsafe { color: #E28C14; } .function.unsafe { color: #BC8383; }
.operator.unsafe { color: #BC8383; }
.parameter { color: #94BFF3; } .parameter { color: #94BFF3; }
.text { color: #DCDCCC; } .text { color: #DCDCCC; }
.type { color: #7CB8BB; } .type { color: #7CB8BB; }

View file

@ -69,7 +69,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.string_literal { color: #CC9393; } .string_literal { color: #CC9393; }
.field { color: #94BFF3; } .field { color: #94BFF3; }
.function { color: #93E0E3; } .function { color: #93E0E3; }
.operator.unsafe { color: #E28C14; } .function.unsafe { color: #BC8383; }
.operator.unsafe { color: #BC8383; }
.parameter { color: #94BFF3; } .parameter { color: #94BFF3; }
.text { color: #DCDCCC; } .text { color: #DCDCCC; }
.type { color: #7CB8BB; } .type { color: #7CB8BB; }

View file

@ -274,7 +274,7 @@ fn main() {
unsafe { unsafe {
unsafe_fn(); unsafe_fn();
HasUnsafeFn.unsafe_method(); HasUnsafeFn.unsafe_method();
let y = *x; let y = *(x);
let z = -x; let z = -x;
} }
} }