diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-28 15:56:07 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-28 15:56:07 +0000 |
commit | c692e07b4ff648fea742c53c0dbad57d6f652068 (patch) | |
tree | d186df8fb298272eaa4ce14d2fccc854413bc566 /crates/ra_ide/src/syntax_highlighting/tests.rs | |
parent | 93f632ca4e7bb7fd54830e456d629a4948a92337 (diff) | |
parent | 56ce34c6a7ec0b4426d4cb25e10512c7efaf6f06 (diff) |
Merge #3367
3367: Fix highlighting of const patterns r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/tests.rs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index 2d90a072f..98c030791 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs | |||
@@ -17,9 +17,8 @@ struct Foo { | |||
17 | pub y: i32, | 17 | pub y: i32, |
18 | } | 18 | } |
19 | 19 | ||
20 | fn foo<T>() -> T { | 20 | fn foo<'a, T>() -> T { |
21 | unimplemented!(); | 21 | foo::<'a, i32>() |
22 | foo::<i32>(); | ||
23 | } | 22 | } |
24 | 23 | ||
25 | macro_rules! def_fn { | 24 | macro_rules! def_fn { |
@@ -50,12 +49,19 @@ fn main() { | |||
50 | y; | 49 | y; |
51 | } | 50 | } |
52 | 51 | ||
53 | enum E<X> { | 52 | enum Option<T> { |
54 | V(X) | 53 | Some(T), |
54 | None, | ||
55 | } | 55 | } |
56 | 56 | use Option::*; | |
57 | impl<X> E<X> { | 57 | |
58 | fn new<T>() -> E<T> {} | 58 | impl<T> Option<T> { |
59 | fn and<U>(self, other: Option<U>) -> Option<(T, U)> { | ||
60 | match other { | ||
61 | None => unimplemented!(), | ||
62 | Nope => Nope, | ||
63 | } | ||
64 | } | ||
59 | } | 65 | } |
60 | "# | 66 | "# |
61 | .trim(), | 67 | .trim(), |
@@ -123,5 +129,5 @@ fn test_ranges() { | |||
123 | .highlight_range(FileRange { file_id, range: TextRange::offset_len(82.into(), 1.into()) }) | 129 | .highlight_range(FileRange { file_id, range: TextRange::offset_len(82.into(), 1.into()) }) |
124 | .unwrap(); | 130 | .unwrap(); |
125 | 131 | ||
126 | assert_eq!(&highlights[0].highlight.to_string(), "field"); | 132 | assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); |
127 | } | 133 | } |