mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
internal: switch some tests to minicore
This commit is contained in:
parent
0475201538
commit
7ebac5e54c
3 changed files with 75 additions and 62 deletions
|
@ -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,12 +47,32 @@ pub mod ops {
|
|||
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {}
|
||||
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *mut T {}
|
||||
impl<T: ?Sized + Unsize<U>, 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> [T] {
|
||||
pub fn len(&self) -> usize { loop {} }
|
||||
}
|
||||
}
|
||||
// endregion:slice
|
||||
|
||||
pub mod prelude {
|
||||
pub mod v1 {
|
||||
pub use crate::marker::Sized; // :sized
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue