internal: add result to minicore

This commit is contained in:
Aleksey Kladov 2021-06-15 23:07:25 +03:00
parent ae92057df6
commit 0798cce9e5
2 changed files with 18 additions and 21 deletions

View file

@ -3627,16 +3627,7 @@ impl foo::Foo for u32 {
fn infer_async_ret_type() { fn infer_async_ret_type() {
check_types( check_types(
r#" r#"
//- /main.rs crate:main deps:core //- minicore: future, result
enum Result<T, E> {
Ok(T),
Err(E),
}
use Result::*;
struct Fooey; struct Fooey;
impl Fooey { impl Fooey {
@ -3659,15 +3650,6 @@ async fn get_accounts() -> Result<u32, ()> {
// ^ u32 // ^ u32
Ok(ret) Ok(ret)
} }
//- /core.rs crate:core
#[prelude_import] use future::*;
mod future {
#[lang = "future_trait"]
trait Future {
type Output;
}
}
"#, "#,
); );
} }

View file

@ -17,6 +17,7 @@
//! pin: //! pin:
//! future: pin //! future: pin
//! option: //! option:
//! result:
pub mod marker { pub mod marker {
// region:sized // region:sized
@ -127,6 +128,17 @@ pub mod option {
} }
// endregion:option // endregion:option
// region:result
pub mod result {
pub enum Result<T, E> {
#[lang = "Ok"]
Ok(T),
#[lang = "Err"]
Err(E),
}
}
// endregion:result
// region:pin // region:pin
pub mod pin { pub mod pin {
#[lang = "pin"] #[lang = "pin"]
@ -167,8 +179,11 @@ pub mod task {
pub mod prelude { pub mod prelude {
pub mod v1 { pub mod v1 {
pub use crate::marker::Sized; // :sized pub use crate::{
pub use crate::option::Option::{self, None, Some}; // :option marker::Sized, // :sized
option::Option::{self, None, Some}, // :option
result::Result::{self, Err, Ok}, // :result
};
} }
pub mod rust_2015 { pub mod rust_2015 {