diff options
author | Aleksey Kladov <[email protected]> | 2021-06-16 08:48:07 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-16 10:15:45 +0100 |
commit | 8a4d9bb80a484193dc24c474af30d0d0e091963b (patch) | |
tree | 88eefd90d8cca113dfe2758def3fb3266ce56a68 /crates/test_utils/src | |
parent | d2c9f3add10a020d6ef7b674b7a722a1d0846f2d (diff) |
internal: add fn to minicore
Diffstat (limited to 'crates/test_utils/src')
-rw-r--r-- | crates/test_utils/src/fixture.rs | 4 | ||||
-rw-r--r-- | crates/test_utils/src/minicore.rs | 28 |
2 files changed, 28 insertions, 4 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index 313088c37..005a5c092 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -164,7 +164,9 @@ impl Fixture { | |||
164 | let mut env = FxHashMap::default(); | 164 | let mut env = FxHashMap::default(); |
165 | let mut introduce_new_source_root = false; | 165 | let mut introduce_new_source_root = false; |
166 | for component in components[1..].iter() { | 166 | for component in components[1..].iter() { |
167 | let (key, value) = component.split_once(':').unwrap(); | 167 | let (key, value) = component |
168 | .split_once(':') | ||
169 | .unwrap_or_else(|| panic!("invalid meta line: {:?}", meta)); | ||
168 | match key { | 170 | match key { |
169 | "crate" => krate = Some(value.to_string()), | 171 | "crate" => krate = Some(value.to_string()), |
170 | "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), | 172 | "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), |
diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs index 8555ff935..e04ca58d2 100644 --- a/crates/test_utils/src/minicore.rs +++ b/crates/test_utils/src/minicore.rs | |||
@@ -9,12 +9,13 @@ | |||
9 | //! | 9 | //! |
10 | //! Available flags: | 10 | //! Available flags: |
11 | //! sized: | 11 | //! sized: |
12 | //! unsize: sized | ||
13 | //! coerce_unsized: unsize | ||
12 | //! slice: | 14 | //! slice: |
13 | //! range: | 15 | //! range: |
14 | //! unsize: sized | ||
15 | //! deref: sized | 16 | //! deref: sized |
16 | //! deref_mut: deref | 17 | //! deref_mut: deref |
17 | //! coerce_unsized: unsize | 18 | //! fn: |
18 | //! pin: | 19 | //! pin: |
19 | //! future: pin | 20 | //! future: pin |
20 | //! option: | 21 | //! option: |
@@ -74,7 +75,7 @@ pub mod ops { | |||
74 | } | 75 | } |
75 | pub use self::deref::Deref; | 76 | pub use self::deref::Deref; |
76 | pub use self::deref::DerefMut; //:deref_mut | 77 | pub use self::deref::DerefMut; //:deref_mut |
77 | // endregion:deref | 78 | // endregion:deref |
78 | 79 | ||
79 | // region:range | 80 | // region:range |
80 | mod range { | 81 | mod range { |
@@ -112,6 +113,26 @@ pub mod ops { | |||
112 | pub use self::range::{Range, RangeFrom, RangeFull, RangeTo}; | 113 | pub use self::range::{Range, RangeFrom, RangeFull, RangeTo}; |
113 | pub use self::range::{RangeInclusive, RangeToInclusive}; | 114 | pub use self::range::{RangeInclusive, RangeToInclusive}; |
114 | // endregion:range | 115 | // endregion:range |
116 | |||
117 | // region:fn | ||
118 | mod function { | ||
119 | #[lang = "fn"] | ||
120 | #[fundamental] | ||
121 | pub trait Fn<Args>: FnMut<Args> {} | ||
122 | |||
123 | #[lang = "fn_mut"] | ||
124 | #[fundamental] | ||
125 | pub trait FnMut<Args>: FnOnce<Args> {} | ||
126 | |||
127 | #[lang = "fn_once"] | ||
128 | #[fundamental] | ||
129 | pub trait FnOnce<Args> { | ||
130 | #[lang = "fn_once_output"] | ||
131 | type Output; | ||
132 | } | ||
133 | } | ||
134 | pub use self::function::{Fn, FnMut, FnOnce}; | ||
135 | // endregion:fn | ||
115 | } | 136 | } |
116 | 137 | ||
117 | // region:slice | 138 | // region:slice |
@@ -189,6 +210,7 @@ pub mod prelude { | |||
189 | pub mod v1 { | 210 | pub mod v1 { |
190 | pub use crate::{ | 211 | pub use crate::{ |
191 | marker::Sized, // :sized | 212 | marker::Sized, // :sized |
213 | ops::{Fn, FnMut, FnOnce}, // :fn | ||
192 | option::Option::{self, None, Some}, // :option | 214 | option::Option::{self, None, Some}, // :option |
193 | result::Result::{self, Err, Ok}, // :result | 215 | result::Result::{self, Err, Ok}, // :result |
194 | }; | 216 | }; |