diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
index 0bb0928e44aa..0cb84866d648 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
@@ -44,6 +44,17 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
pub trait Copy {}
}
+pub mod ops {
+ #[lang = "fn_once"]
+ pub trait FnOnce<Args> {}
+
+ #[lang = "fn_mut"]
+ pub trait FnMut<Args>: FnOnce<Args> {}
+
+ #[lang = "fn"]
+ pub trait Fn<Args>: FnMut<Args> {}
+}
+
struct Foo {
pub x: i32,
@@ -99,6 +110,11 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
foo::<'a, i32>()
}
+use ops::Fn;
+fn baz<F: Fn() -> ()>(f: F) {
+ f()
+}
+
macro_rules! def_fn {
($($tt:tt)*) => {$($tt)*}
}
@@ -157,6 +173,9 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
copy.quop();
copy.qux();
copy.baz(copy);
+
+ let a = |x| x;
+ let bar = Foo::baz;
}
enum Option<T> {
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 126363b8beb4..da20c300e28b 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -18,6 +18,17 @@ pub mod marker {
pub trait Copy {}
}
+pub mod ops {
+ #[lang = "fn_once"]
+ pub trait FnOnce {}
+
+ #[lang = "fn_mut"]
+ pub trait FnMut: FnOnce {}
+
+ #[lang = "fn"]
+ pub trait Fn: FnMut {}
+}
+
struct Foo {
pub x: i32,
@@ -73,6 +84,11 @@ fn foo<'a, T>() -> T {
foo::<'a, i32>()
}
+use ops::Fn;
+fn baz ()>(f: F) {
+ f()
+}
+
macro_rules! def_fn {
($($tt:tt)*) => {$($tt)*}
}
@@ -131,6 +147,9 @@ fn main() {
copy.quop();
copy.qux();
copy.baz(copy);
+
+ let a = |x| x;
+ let bar = Foo::baz;
}
enum Option {