diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index da20c300e..2b667b0d4 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -84,11 +84,21 @@ fn foo<'a, T>() -> T { | |||
84 | foo::<'a, i32>() | 84 | foo::<'a, i32>() |
85 | } | 85 | } |
86 | 86 | ||
87 | fn never() -> ! { | ||
88 | loop {} | ||
89 | } | ||
90 | |||
87 | use ops::Fn; | 91 | use ops::Fn; |
88 | fn baz<F: Fn() -> ()>(f: F) { | 92 | fn baz<F: Fn() -> ()>(f: F) { |
89 | f() | 93 | f() |
90 | } | 94 | } |
91 | 95 | ||
96 | fn foobar() -> impl Copy {} | ||
97 | |||
98 | fn foo() { | ||
99 | let bar = foobar(); | ||
100 | } | ||
101 | |||
92 | macro_rules! def_fn { | 102 | macro_rules! def_fn { |
93 | ($($tt:tt)*) => {$($tt)*} | 103 | ($($tt:tt)*) => {$($tt)*} |
94 | } | 104 | } |
@@ -150,6 +160,11 @@ fn main() { | |||
150 | 160 | ||
151 | let a = |x| x; | 161 | let a = |x| x; |
152 | let bar = Foo::baz; | 162 | let bar = Foo::baz; |
163 | |||
164 | let baz = -42; | ||
165 | let baz = -baz; | ||
166 | |||
167 | let _ = !true; | ||
153 | } | 168 | } |
154 | 169 | ||
155 | enum Option<T> { | 170 | enum Option<T> { |