diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 9f864179e2e9..624a6307564c 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -562,6 +562,9 @@ fn highlight_element(
T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => {
HighlightTag::Macro.into()
}
+ T![!] if element.parent().and_then(ast::NeverType::cast).is_some() => {
+ HighlightTag::BuiltinType.into()
+ }
T![*] if element.parent().and_then(ast::PtrType::cast).is_some() => {
HighlightTag::Keyword.into()
}
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
index c6b4f5a00231..b0e547d57889 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
@@ -110,6 +110,10 @@
foo::<'a, i32>()
}
+fn never() -> ! {
+ loop {}
+}
+
use ops::Fn;
fn baz<F: Fn() -> ()>(f: F) {
f()
@@ -179,6 +183,8 @@
let baz = -42;
let baz = -baz;
+
+ let _ = !true;
}
enum Option<T> {
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index dd43f9dd955d..f13cf3ef33ca 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -84,6 +84,10 @@ fn foo<'a, T>() -> T {
foo::<'a, i32>()
}
+fn never() -> ! {
+ loop {}
+}
+
use ops::Fn;
fn baz ()>(f: F) {
f()
@@ -153,6 +157,8 @@ fn main() {
let baz = -42;
let baz = -baz;
+
+ let _ = !true;
}
enum Option {