From 2870d2bade94ae276cba56caf8c35feaacd49422 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jun 2021 22:59:51 +0300 Subject: internal: add option to minicore --- crates/hir_ty/src/tests/traits.rs | 46 +++++---------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) (limited to 'crates/hir_ty') diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 33689e081..6df8181ed 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs @@ -26,25 +26,14 @@ fn test() { fn infer_async() { check_types( r#" -//- /main.rs crate:main deps:core -async fn foo() -> u64 { - 128 -} +//- minicore: future +async fn foo() -> u64 { 128 } fn test() { let r = foo(); let v = r.await; v; } //^ u64 - -//- /core.rs crate:core -#[prelude_import] use future::*; -mod future { - #[lang = "future_trait"] - trait Future { - type Output; - } -} "#, ); } @@ -53,24 +42,13 @@ mod future { fn infer_desugar_async() { check_types( r#" -//- /main.rs crate:main deps:core -async fn foo() -> u64 { - 128 -} +//- minicore: future +async fn foo() -> u64 { 128 } fn test() { let r = foo(); r; } //^ impl Future - -//- /core.rs crate:core -#[prelude_import] use future::*; -mod future { - trait Future { - type Output; - } -} - "#, ); } @@ -79,7 +57,7 @@ mod future { fn infer_async_block() { check_types( r#" -//- /main.rs crate:main deps:core +//- minicore: future, option async fn test() { let a = async { 42 }; a; @@ -91,7 +69,7 @@ async fn test() { b; // ^ () let c = async { - let y = Option::None; + let y = None; y // ^ Option }; @@ -99,18 +77,6 @@ async fn test() { c; // ^ impl Future> } - -enum Option { None, Some(T) } - -//- /core.rs crate:core -#[prelude_import] use future::*; -mod future { - #[lang = "future_trait"] - trait Future { - type Output; - } -} - "#, ); } -- cgit v1.2.3