diff options
| author | Florian Diebold <flodiebold@gmail.com> | 2022-03-23 19:47:11 +0100 |
|---|---|---|
| committer | Florian Diebold <flodiebold@gmail.com> | 2022-03-23 19:47:11 +0100 |
| commit | e0e6bfb9242fad53e3ed49c59e23eaf6653ff13e (patch) | |
| tree | 3bc6b48b326b43b3c5acffe6513d6a31f92ed3e3 | |
| parent | fa923f9b194dcd5334d34921b36785d118ec1ae5 (diff) | |
| download | rust-e0e6bfb9242fad53e3ed49c59e23eaf6653ff13e.tar.gz rust-e0e6bfb9242fad53e3ed49c59e23eaf6653ff13e.zip | |
Fix filter_map in minicore
| -rw-r--r-- | crates/hir_ty/src/tests/method_resolution.rs | 12 | ||||
| -rw-r--r-- | crates/test_utils/src/minicore.rs | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs index 95957f62358..011347e5c45 100644 --- a/crates/hir_ty/src/tests/method_resolution.rs +++ b/crates/hir_ty/src/tests/method_resolution.rs @@ -1750,3 +1750,15 @@ pub fn test() { "#, ); } + +#[test] +fn resolve_minicore_iterator() { + check_types( + r#" +//- minicore: iterators, sized +fn foo() { + let m = core::iter::repeat(()).filter_map(|()| Some(92)).next(); +} //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Option<i32> +"#, + ); +} diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs index 5c63e27879d..8474014a2cb 100644 --- a/crates/test_utils/src/minicore.rs +++ b/crates/test_utils/src/minicore.rs @@ -518,7 +518,7 @@ pub mod iter { } } } - pub use self::adapters::Take; + pub use self::adapters::{Take, FilterMap}; mod sources { mod repeat { |
