diff options
author | Aleksey Kladov <[email protected]> | 2021-06-18 21:56:15 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-18 21:59:47 +0100 |
commit | 3762cc7465e485948b426857b265f274688dedea (patch) | |
tree | 680a9bc7a1d2fbd755bca0ffd12d256c33cf1063 /crates/ide_assists/src/tests | |
parent | 90da9fc9b302de46097065f0d6428ad33c292217 (diff) |
minor: use minicore
Diffstat (limited to 'crates/ide_assists/src/tests')
-rw-r--r-- | crates/ide_assists/src/tests/generated.rs | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs index de5d9e55a..1509c3c63 100644 --- a/crates/ide_assists/src/tests/generated.rs +++ b/crates/ide_assists/src/tests/generated.rs | |||
@@ -209,10 +209,7 @@ fn doctest_convert_into_to_from() { | |||
209 | check_doc_test( | 209 | check_doc_test( |
210 | "convert_into_to_from", | 210 | "convert_into_to_from", |
211 | r#####" | 211 | r#####" |
212 | //- /lib.rs crate:core | 212 | //- minicore: from |
213 | pub mod convert { pub trait Into<T> { pub fn into(self) -> T; } } | ||
214 | //- /lib.rs crate:main deps:core | ||
215 | use core::convert::Into; | ||
216 | impl $0Into<Thing> for usize { | 213 | impl $0Into<Thing> for usize { |
217 | fn into(self) -> Thing { | 214 | fn into(self) -> Thing { |
218 | Thing { | 215 | Thing { |
@@ -223,7 +220,6 @@ impl $0Into<Thing> for usize { | |||
223 | } | 220 | } |
224 | "#####, | 221 | "#####, |
225 | r#####" | 222 | r#####" |
226 | use core::convert::Into; | ||
227 | impl From<usize> for Thing { | 223 | impl From<usize> for Thing { |
228 | fn from(val: usize) -> Self { | 224 | fn from(val: usize) -> Self { |
229 | Thing { | 225 | Thing { |
@@ -241,23 +237,19 @@ fn doctest_convert_iter_for_each_to_for() { | |||
241 | check_doc_test( | 237 | check_doc_test( |
242 | "convert_iter_for_each_to_for", | 238 | "convert_iter_for_each_to_for", |
243 | r#####" | 239 | r#####" |
244 | //- /lib.rs crate:core | 240 | //- minicore: iterators |
245 | pub mod iter { pub mod traits { pub mod iterator { pub trait Iterator {} } } } | 241 | use core::iter; |
246 | pub struct SomeIter; | ||
247 | impl self::iter::traits::iterator::Iterator for SomeIter {} | ||
248 | //- /lib.rs crate:main deps:core | ||
249 | use core::SomeIter; | ||
250 | fn main() { | 242 | fn main() { |
251 | let iter = SomeIter; | 243 | let iter = iter::repeat((9, 2)); |
252 | iter.for_each$0(|(x, y)| { | 244 | iter.for_each$0(|(x, y)| { |
253 | println!("x: {}, y: {}", x, y); | 245 | println!("x: {}, y: {}", x, y); |
254 | }); | 246 | }); |
255 | } | 247 | } |
256 | "#####, | 248 | "#####, |
257 | r#####" | 249 | r#####" |
258 | use core::SomeIter; | 250 | use core::iter; |
259 | fn main() { | 251 | fn main() { |
260 | let iter = SomeIter; | 252 | let iter = iter::repeat((9, 2)); |
261 | for (x, y) in iter { | 253 | for (x, y) in iter { |
262 | println!("x: {}, y: {}", x, y); | 254 | println!("x: {}, y: {}", x, y); |
263 | } | 255 | } |
@@ -1519,16 +1511,15 @@ fn doctest_replace_unwrap_with_match() { | |||
1519 | check_doc_test( | 1511 | check_doc_test( |
1520 | "replace_unwrap_with_match", | 1512 | "replace_unwrap_with_match", |
1521 | r#####" | 1513 | r#####" |
1522 | enum Result<T, E> { Ok(T), Err(E) } | 1514 | //- minicore: result |
1523 | fn main() { | 1515 | fn main() { |
1524 | let x: Result<i32, i32> = Result::Ok(92); | 1516 | let x: Result<i32, i32> = Ok(92); |
1525 | let y = x.$0unwrap(); | 1517 | let y = x.$0unwrap(); |
1526 | } | 1518 | } |
1527 | "#####, | 1519 | "#####, |
1528 | r#####" | 1520 | r#####" |
1529 | enum Result<T, E> { Ok(T), Err(E) } | ||
1530 | fn main() { | 1521 | fn main() { |
1531 | let x: Result<i32, i32> = Result::Ok(92); | 1522 | let x: Result<i32, i32> = Ok(92); |
1532 | let y = match x { | 1523 | let y = match x { |
1533 | Ok(it) => it, | 1524 | Ok(it) => it, |
1534 | $0_ => unreachable!(), | 1525 | $0_ => unreachable!(), |