mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
⬆️ rust-analyzer
This commit is contained in:
parent
15b867b5db
commit
b2f6fd4f96
217 changed files with 12639 additions and 3059 deletions
|
@ -510,6 +510,7 @@ pub mod fmt {
|
|||
pub mod slice {
|
||||
#[lang = "slice"]
|
||||
impl<T> [T] {
|
||||
#[lang = "slice_len_fn"]
|
||||
pub fn len(&self) -> usize {
|
||||
loop {}
|
||||
}
|
||||
|
@ -533,6 +534,40 @@ pub mod option {
|
|||
None => panic!("called `Option::unwrap()` on a `None` value"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn and<U>(self, optb: Option<U>) -> Option<U> {
|
||||
loop {}
|
||||
}
|
||||
pub fn unwrap_or(self, default: T) -> T {
|
||||
loop {}
|
||||
}
|
||||
// region:fn
|
||||
pub fn and_then<U, F>(self, f: F) -> Option<U>
|
||||
where
|
||||
F: FnOnce(T) -> Option<U>,
|
||||
{
|
||||
loop {}
|
||||
}
|
||||
pub fn unwrap_or_else<F>(self, f: F) -> T
|
||||
where
|
||||
F: FnOnce() -> T,
|
||||
{
|
||||
loop {}
|
||||
}
|
||||
pub fn map_or<U, F>(self, default: U, f: F) -> U
|
||||
where
|
||||
F: FnOnce(T) -> U,
|
||||
{
|
||||
loop {}
|
||||
}
|
||||
pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U
|
||||
where
|
||||
D: FnOnce() -> U,
|
||||
F: FnOnce(T) -> U,
|
||||
{
|
||||
loop {}
|
||||
}
|
||||
// endregion:fn
|
||||
}
|
||||
}
|
||||
// endregion:option
|
||||
|
@ -727,6 +762,20 @@ pub mod iter {
|
|||
self
|
||||
}
|
||||
}
|
||||
pub struct IntoIter<T, const N: usize>([T; N]);
|
||||
impl<T, const N: usize> IntoIterator for [T; N] {
|
||||
type Item = T;
|
||||
type IntoIter = IntoIter<T, N>;
|
||||
fn into_iter(self) -> I {
|
||||
IntoIter(self)
|
||||
}
|
||||
}
|
||||
impl<T, const N: usize> Iterator for IntoIter<T, N> {
|
||||
type Item = T;
|
||||
fn next(&mut self) -> Option<T> {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
}
|
||||
pub use self::collect::IntoIterator;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue