diff options
Diffstat (limited to 'crates/ide_db/src/helpers')
-rw-r--r-- | crates/ide_db/src/helpers/famous_defs_fixture.rs | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/crates/ide_db/src/helpers/famous_defs_fixture.rs b/crates/ide_db/src/helpers/famous_defs_fixture.rs index 312851966..551203936 100644 --- a/crates/ide_db/src/helpers/famous_defs_fixture.rs +++ b/crates/ide_db/src/helpers/famous_defs_fixture.rs | |||
@@ -26,100 +26,6 @@ pub mod default { | |||
26 | } | 26 | } |
27 | } | 27 | } |
28 | 28 | ||
29 | pub mod iter { | ||
30 | pub use self::traits::{collect::IntoIterator, iterator::Iterator}; | ||
31 | mod traits { | ||
32 | pub(crate) mod iterator { | ||
33 | use crate::option::Option; | ||
34 | pub trait Iterator { | ||
35 | type Item; | ||
36 | fn next(&mut self) -> Option<Self::Item>; | ||
37 | fn by_ref(&mut self) -> &mut Self { | ||
38 | self | ||
39 | } | ||
40 | fn take(self, n: usize) -> crate::iter::Take<Self> { | ||
41 | crate::iter::Take { inner: self } | ||
42 | } | ||
43 | } | ||
44 | |||
45 | impl<I: Iterator> Iterator for &mut I { | ||
46 | type Item = I::Item; | ||
47 | fn next(&mut self) -> Option<I::Item> { | ||
48 | (**self).next() | ||
49 | } | ||
50 | } | ||
51 | } | ||
52 | pub(crate) mod collect { | ||
53 | pub trait IntoIterator { | ||
54 | type Item; | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | |||
59 | pub use self::sources::*; | ||
60 | pub(crate) mod sources { | ||
61 | use super::Iterator; | ||
62 | use crate::option::Option::{self, *}; | ||
63 | pub struct Repeat<A> { | ||
64 | element: A, | ||
65 | } | ||
66 | |||
67 | pub fn repeat<T>(elt: T) -> Repeat<T> { | ||
68 | Repeat { element: elt } | ||
69 | } | ||
70 | |||
71 | impl<A> Iterator for Repeat<A> { | ||
72 | type Item = A; | ||
73 | |||
74 | fn next(&mut self) -> Option<A> { | ||
75 | None | ||
76 | } | ||
77 | } | ||
78 | } | ||
79 | |||
80 | pub use self::adapters::*; | ||
81 | pub(crate) mod adapters { | ||
82 | use super::Iterator; | ||
83 | use crate::option::Option::{self, *}; | ||
84 | pub struct Take<I> { | ||
85 | pub(crate) inner: I, | ||
86 | } | ||
87 | impl<I> Iterator for Take<I> | ||
88 | where | ||
89 | I: Iterator, | ||
90 | { | ||
91 | type Item = <I as Iterator>::Item; | ||
92 | fn next(&mut self) -> Option<<I as Iterator>::Item> { | ||
93 | None | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | |||
99 | pub mod ops { | ||
100 | #[lang = "fn"] | ||
101 | pub trait Fn<Args>: FnMut<Args> { | ||
102 | extern "rust-call" fn call(&self, args: Args) -> Self::Output; | ||
103 | } | ||
104 | |||
105 | #[lang = "fn_mut"] | ||
106 | pub trait FnMut<Args>: FnOnce<Args> { | ||
107 | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; | ||
108 | } | ||
109 | #[lang = "fn_once"] | ||
110 | pub trait FnOnce<Args> { | ||
111 | #[lang = "fn_once_output"] | ||
112 | type Output; | ||
113 | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; | ||
114 | } | ||
115 | |||
116 | #[lang = "deref"] | ||
117 | pub trait Deref { | ||
118 | type Target: ?Sized; | ||
119 | fn deref(&self) -> &Self::Target; | ||
120 | } | ||
121 | } | ||
122 | |||
123 | pub mod option { | 29 | pub mod option { |
124 | pub enum Option<T> { | 30 | pub enum Option<T> { |
125 | None, | 31 | None, |