diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-23 15:55:03 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-23 15:55:03 +0100 |
commit | c0b9ae55034fd29a86f52822634fcb1c1303e7f9 (patch) | |
tree | 4a97c8939ae27fa3c3f30fa46729383a71b810e7 /crates/ra_assists/src/handlers/split_import.rs | |
parent | 3e09dbba94de103d4d7a211ec578b049d0adc3c7 (diff) | |
parent | 76ddface089886c88b8b29e3893119f38ef26aab (diff) |
Merge #5004
5004: Fix panic in split/merge import assists r=matklad a=lnicola
Fixes #4368 #4905
Not sure if this is the best solution here. Maybe the `make` functions should be fallible? We generally seem to be playing whack-a-mole with panics in assists, although most of them are `unwrap`s in the assist code.
Co-authored-by: Laurențiu Nicola <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/split_import.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/split_import.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_assists/src/handlers/split_import.rs b/crates/ra_assists/src/handlers/split_import.rs index c7a874480..38aa199a0 100644 --- a/crates/ra_assists/src/handlers/split_import.rs +++ b/crates/ra_assists/src/handlers/split_import.rs | |||
@@ -66,4 +66,14 @@ mod tests { | |||
66 | fn issue4044() { | 66 | fn issue4044() { |
67 | check_assist_not_applicable(split_import, "use crate::<|>:::self;") | 67 | check_assist_not_applicable(split_import, "use crate::<|>:::self;") |
68 | } | 68 | } |
69 | |||
70 | #[test] | ||
71 | fn test_empty_use() { | ||
72 | check_assist_not_applicable( | ||
73 | split_import, | ||
74 | r" | ||
75 | use std::<|> | ||
76 | fn main() {}", | ||
77 | ); | ||
78 | } | ||
69 | } | 79 | } |