Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/inlay_hints/bind_pat.rs')
-rw-r--r--crates/ide/src/inlay_hints/bind_pat.rs49
1 files changed, 25 insertions, 24 deletions
diff --git a/crates/ide/src/inlay_hints/bind_pat.rs b/crates/ide/src/inlay_hints/bind_pat.rs
index 1c2289158b..c29fd83bb5 100644
--- a/crates/ide/src/inlay_hints/bind_pat.rs
+++ b/crates/ide/src/inlay_hints/bind_pat.rs
@@ -391,36 +391,37 @@ fn main() {
#[test]
fn check_hint_range_limit() {
let fixture = r#"
- //- minicore: fn, sized
- fn foo() -> impl Fn() { loop {} }
- fn foo1() -> impl Fn(f64) { loop {} }
- fn foo2() -> impl Fn(f64, f64) { loop {} }
- fn foo3() -> impl Fn(f64, f64) -> u32 { loop {} }
- fn foo4() -> &'static dyn Fn(f64, f64) -> u32 { loop {} }
- fn foo5() -> &'static dyn Fn(&'static dyn Fn(f64, f64) -> u32, f64) -> u32 { loop {} }
- fn foo6() -> impl Fn(f64, f64) -> u32 + Sized { loop {} }
- fn foo7() -> *const (impl Fn(f64, f64) -> u32 + Sized) { loop {} }
-
- fn main() {
- let foo = foo();
- let foo = foo1();
- let foo = foo2();
- // ^^^ impl Fn(f64, f64)
- let foo = foo3();
- // ^^^ impl Fn(f64, f64) -> u32
- let foo = foo4();
- let foo = foo5();
- let foo = foo6();
- let foo = foo7();
- }
- "#;
+//- minicore: fn, sized
+fn foo() -> impl Fn() { loop {} }
+fn foo1() -> impl Fn(f64) { loop {} }
+fn foo2() -> impl Fn(f64, f64) { loop {} }
+fn foo3() -> impl Fn(f64, f64) -> u32 { loop {} }
+fn foo4() -> &'static dyn Fn(f64, f64) -> u32 { loop {} }
+fn foo5() -> &'static dyn Fn(&'static dyn Fn(f64, f64) -> u32, f64) -> u32 { loop {} }
+fn foo6() -> impl Fn(f64, f64) -> u32 + Sized { loop {} }
+fn foo7() -> *const (impl Fn(f64, f64) -> u32 + Sized) { loop {} }
+
+fn main() {
+ let foo = foo();
+ let foo = foo1();
+ let foo = foo2();
+ // ^^^ impl Fn(f64, f64)
+ let foo = foo3();
+ // ^^^ impl Fn(f64, f64) -> u32
+ let foo = foo4();
+ // ^^^ &dyn Fn(f64, f64) -> u32
+ let foo = foo5();
+ let foo = foo6();
+ let foo = foo7();
+}
+"#;
let (analysis, file_id) = fixture::file(fixture);
let expected = extract_annotations(&analysis.file_text(file_id).unwrap());
let inlay_hints = analysis
.inlay_hints(
&InlayHintsConfig { type_hints: true, ..DISABLED_CONFIG },
file_id,
- Some(TextRange::new(TextSize::from(500), TextSize::from(600))),
+ Some(TextRange::new(TextSize::from(491), TextSize::from(640))),
)
.unwrap();
let actual =