aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-15 19:34:26 +0100
committerAleksey Kladov <[email protected]>2021-06-15 19:34:26 +0100
commit7ebac5e54c51c6b8f1ddf3bb905f625416cc09fa (patch)
tree1eb45c7a221654c7da7ac3baebbb6deb02271593 /crates/test_utils/src
parent047520153878ade5b0136bc151fc53a43419b1c9 (diff)
internal: switch some tests to minicore
Diffstat (limited to 'crates/test_utils/src')
-rw-r--r--crates/test_utils/src/minicore.rs28
1 files changed, 25 insertions, 3 deletions
diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs
index 8f8f1c9f8..a61459f6d 100644
--- a/crates/test_utils/src/minicore.rs
+++ b/crates/test_utils/src/minicore.rs
@@ -9,7 +9,9 @@
9//! 9//!
10//! Available flags: 10//! Available flags:
11//! sized: 11//! sized:
12//! slice:
12//! unsize: sized 13//! unsize: sized
14//! deref: sized
13//! coerce_unsized: unsize 15//! coerce_unsized: unsize
14 16
15pub mod marker { 17pub mod marker {
@@ -27,8 +29,8 @@ pub mod marker {
27} 29}
28 30
29pub mod ops { 31pub mod ops {
32 // region:coerce_unsized
30 mod unsize { 33 mod unsize {
31 // region:coerce_unsized
32 use crate::marker::Unsize; 34 use crate::marker::Unsize;
33 35
34 #[lang = "coerce_unsized"] 36 #[lang = "coerce_unsized"]
@@ -45,11 +47,31 @@ pub mod ops {
45 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {} 47 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {}
46 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *mut T {} 48 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *mut T {}
47 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {} 49 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
48 // endregion:coerce_unsized
49 } 50 }
51 pub use self::unsize::CoerceUnsized;
52 // endregion:coerce_unsized
50 53
51 pub use self::unsize::CoerceUnsized; // :coerce_unsized 54 // region:deref
55 mod deref {
56 #[lang = "deref"]
57 pub trait Deref {
58 #[lang = "deref_target"]
59 type Target: ?Sized;
60 fn deref(&self) -> &Self::Target;
61 }
62 }
63 pub use self::deref::Deref;
64 // endregion:deref
65}
66
67// region:slice
68pub mod slice {
69 #[lang = "slice"]
70 impl<T> [T] {
71 pub fn len(&self) -> usize { loop {} }
72 }
52} 73}
74// endregion:slice
53 75
54pub mod prelude { 76pub mod prelude {
55 pub mod v1 { 77 pub mod v1 {