From 436dcd9656b89b10a9719828a3421b4586ac331f Mon Sep 17 00:00:00 2001 From: adamrk Date: Sat, 20 Jun 2020 11:32:01 +0200 Subject: move tests to ra_hir_ty --- crates/ra_ide/src/hover.rs | 104 --------------------------------------------- 1 file changed, 104 deletions(-) (limited to 'crates/ra_ide/src/hover.rs') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index a03024d09..d870e4cbc 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -2410,108 +2410,4 @@ fn func(foo: i32) { if true { <|>foo; }; } ] "###); } - - #[test] - fn infer_closure_arg() { - check_hover_result( - r#" - //- /lib.rs - - enum Option { - None, - Some(T) - } - - fn foo() { - let s<|> = Option::None; - let f = |x: Option| {}; - (&f)(s) - } - "#, - &["Option"], - ); - } - - #[test] - fn infer_fn_trait_arg() { - check_hover_result( - r#" - //- /lib.rs deps:std - - #[lang = "fn_once"] - pub trait FnOnce { - type Output; - - extern "rust-call" fn call_once(&self, args: Args) -> Self::Output; - } - - #[lang = "fn"] - pub trait Fn:FnOnce { - extern "rust-call" fn call(&self, args: Args) -> Self::Output; - } - - enum Option { - None, - Some(T) - } - - fn foo(f: F) -> T - where - F: Fn(Option) -> T, - { - let s<|> = None; - f(s) - } - "#, - &["Option"], - ); - } - - #[test] - fn infer_box_fn_arg() { - check_hover_result( - r#" - //- /lib.rs deps:std - - #[lang = "fn_once"] - pub trait FnOnce { - type Output; - - extern "rust-call" fn call_once(self, args: Args) -> Self::Output; - } - - #[lang = "deref"] - pub trait Deref { - type Target: ?Sized; - - fn deref(&self) -> &Self::Target; - } - - #[lang = "owned_box"] - pub struct Box { - inner: *mut T, - } - - impl Deref for Box { - type Target = T; - - fn deref(&self) -> &T { - &self.inner - } - } - - enum Option { - None, - Some(T) - } - - fn foo() { - let s<|> = Option::None; - let f: Box)> = box (|ps| {}); - f(&s) - } - "#, - &["Option"], - ); - } } -- cgit v1.2.3