From a35ff6edf44519cc3b07869d8e5754c607b913cd Mon Sep 17 00:00:00 2001 From: GrayJack Date: Wed, 21 Oct 2020 01:54:51 -0300 Subject: Add tests for callable modifier --- .../syntax_highlighting/test_data/highlighting.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/ide/src/syntax_highlighting/test_data/highlighting.html') diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html index 0bb0928e4..0cb84866d 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> { -- cgit v1.2.3