From 7ebac5e54c51c6b8f1ddf3bb905f625416cc09fa Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jun 2021 21:34:26 +0300 Subject: internal: switch some tests to minicore --- crates/test_utils/src/minicore.rs | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'crates/test_utils') 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 @@ //! //! Available flags: //! sized: +//! slice: //! unsize: sized +//! deref: sized //! coerce_unsized: unsize pub mod marker { @@ -27,8 +29,8 @@ pub mod marker { } pub mod ops { + // region:coerce_unsized mod unsize { - // region:coerce_unsized use crate::marker::Unsize; #[lang = "coerce_unsized"] @@ -45,11 +47,31 @@ pub mod ops { impl, U: ?Sized> CoerceUnsized<*mut U> for *mut T {} impl, U: ?Sized> CoerceUnsized<*const U> for *mut T {} impl, U: ?Sized> CoerceUnsized<*const U> for *const T {} - // endregion:coerce_unsized } + pub use self::unsize::CoerceUnsized; + // endregion:coerce_unsized - pub use self::unsize::CoerceUnsized; // :coerce_unsized + // region:deref + mod deref { + #[lang = "deref"] + pub trait Deref { + #[lang = "deref_target"] + type Target: ?Sized; + fn deref(&self) -> &Self::Target; + } + } + pub use self::deref::Deref; + // endregion:deref +} + +// region:slice +pub mod slice { + #[lang = "slice"] + impl [T] { + pub fn len(&self) -> usize { loop {} } + } } +// endregion:slice pub mod prelude { pub mod v1 { -- cgit v1.2.3