about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJake Heinz <jh@discordapp.com>2021-12-01 10:28:18 +0000
committerJake Heinz <jh@discordapp.com>2021-12-01 10:28:18 +0000
commitb357569d0f43481b0149246768d48b26dcc9273f (patch)
tree4f8933803f5e8634c98d192d44bafc62fc4f5385
parentfec2d39f3c316f379b6aad0947b77e24445f3b8b (diff)
downloadrust-b357569d0f43481b0149246768d48b26dcc9273f.tar.gz
rust-b357569d0f43481b0149246768d48b26dcc9273f.zip
add test
-rw-r--r--crates/ide/src/syntax_highlighting/test_data/highlighting.html9
-rw-r--r--crates/ide/src/syntax_highlighting/tests.rs9
2 files changed, 18 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
index ab810aceca3..d8c9827b5e0 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
@@ -265,4 +265,13 @@ proc_macros::<span class="macro">mirror!</span> <span class="brace">{</span>
 <span class="brace">}</span>
 <span class="keyword">const</span> <span class="constant declaration">USAGE_OF_BOOL</span><span class="colon">:</span><span class="builtin_type">bool</span> <span class="operator">=</span> <span class="enum public">Bool</span><span class="operator">::</span><span class="enum_variant public">True</span><span class="operator">.</span><span class="function associated consuming public">to_primitive</span><span class="parenthesis">(</span><span class="parenthesis">)</span><span class="semicolon">;</span>
 
+<span class="keyword">trait</span> <span class="trait declaration">Baz</span> <span class="brace">{</span>
+    <span class="keyword">type</span> <span class="type_alias associated declaration trait">Qux</span><span class="semicolon">;</span>
+<span class="brace">}</span>
+
+<span class="keyword">fn</span> <span class="function declaration">baz</span><span class="angle">&lt;</span><span class="type_param declaration">T</span><span class="angle">&gt;</span><span class="parenthesis">(</span><span class="value_param declaration">t</span><span class="colon">:</span> <span class="type_param">T</span><span class="parenthesis">)</span>
+<span class="keyword">where</span>
+    <span class="type_param">T</span><span class="colon">:</span> <span class="trait">Baz</span><span class="comma">,</span>
+    <span class="angle">&lt;</span><span class="type_param">T</span> <span class="keyword">as</span> <span class="trait">Baz</span><span class="angle">&gt;</span><span class="operator">::</span><span class="type_alias associated trait">Qux</span><span class="colon">:</span> <span class="trait">Bar</span> <span class="brace">{</span><span class="brace">}</span>
+
 </code></pre>
\ No newline at end of file
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 05158c169e0..e74f39a8650 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -238,6 +238,15 @@ impl Bool {
 }
 const USAGE_OF_BOOL:bool = Bool::True.to_primitive();
 
+trait Baz {
+    type Qux;
+}
+
+fn baz<T>(t: T)
+where
+    T: Baz,
+    <T as Baz>::Qux: Bar {}
+
 //- /foo.rs crate:foo
 pub struct Person {
     pub name: &'static str,