From a9623f3165f87124de836e81e238118e557bb9e9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 18 Jun 2021 23:38:19 +0300 Subject: [PATCH] minor: use minicore --- crates/ide/src/inlay_hints.rs | 17 ++++------------- .../ide_assists/src/handlers/fill_match_arms.rs | 11 +++-------- .../ide_completion/src/completions/postfix.rs | 9 +++------ 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 48bab0b2e61..95f9edce4cf 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -661,9 +661,7 @@ fn main() { fn function_call_parameter_hint() { check_params( r#" -enum Option { None, Some(T) } -use Option::*; - +//- minicore: option struct FileId {} struct SmolStr {} @@ -872,7 +870,6 @@ fn fn_hints() { check_types( r#" //- minicore: fn, sized - fn foo() -> impl Fn() { loop {} } fn foo1() -> impl Fn(f64) { loop {} } fn foo2() -> impl Fn(f64, f64) { loop {} } @@ -960,9 +957,7 @@ struct InnerStruct {} fn if_expr() { check_types( r#" -enum Option { None, Some(T) } -use Option::*; - +//- minicore: option struct Test { a: Option, b: u8 } fn main() { @@ -992,9 +987,7 @@ fn main() { fn while_expr() { check_types( r#" -enum Option { None, Some(T) } -use Option::*; - +//- minicore: option struct Test { a: Option, b: u8 } fn main() { @@ -1010,9 +1003,7 @@ fn main() { fn match_arm_list() { check_types( r#" -enum Option { None, Some(T) } -use Option::*; - +//- minicore: option struct Test { a: Option, b: u8 } fn main() { diff --git a/crates/ide_assists/src/handlers/fill_match_arms.rs b/crates/ide_assists/src/handlers/fill_match_arms.rs index cd0f6dba98b..318faa0fca6 100644 --- a/crates/ide_assists/src/handlers/fill_match_arms.rs +++ b/crates/ide_assists/src/handlers/fill_match_arms.rs @@ -481,26 +481,21 @@ fn partial_fill_option() { check_assist( fill_match_arms, r#" -enum Option { Some(T), None } -use Option::*; - +//- minicore: option fn main() { match None$0 { None => {} } } - "#, +"#, r#" -enum Option { Some(T), None } -use Option::*; - fn main() { match None { None => {} Some(${0:_}) => todo!(), } } - "#, +"#, ); } diff --git a/crates/ide_completion/src/completions/postfix.rs b/crates/ide_completion/src/completions/postfix.rs index c11deebcb5e..4e20ec003f4 100644 --- a/crates/ide_completion/src/completions/postfix.rs +++ b/crates/ide_completion/src/completions/postfix.rs @@ -509,18 +509,15 @@ fn postfix_completion_for_references() { check_edit( "ifl", r#" -enum Option { Some(T), None } - +//- minicore: option fn main() { - let bar = &Option::Some(true); + let bar = &Some(true); bar.$0 } "#, r#" -enum Option { Some(T), None } - fn main() { - let bar = &Option::Some(true); + let bar = &Some(true); if let Some($1) = bar { $0 } -- 2.44.0