remove bad_things.rs
This commit is contained in:
parent
6eac2a31f9
commit
9f86e3e85f
|
@ -1,50 +0,0 @@
|
|||
// use std::{fmt::Debug, intrinsics::transmute, mem::{transmute_copy, MaybeUninit, ManuallyDrop}, alloc::{dealloc, Layout}, ptr::drop_in_place};
|
||||
|
||||
// trait IsSized {
|
||||
// type SizedRepr;
|
||||
|
||||
// fn is_sized() -> bool;
|
||||
// }
|
||||
|
||||
// impl<T: ?Sized> IsSized for T {
|
||||
// default type SizedRepr = Box<T>;
|
||||
|
||||
// default fn is_sized() -> bool {
|
||||
// false
|
||||
// }
|
||||
// }
|
||||
|
||||
// impl<T> IsSized for T {
|
||||
// type SizedRepr = T;
|
||||
|
||||
// fn is_sized() -> bool {
|
||||
// true
|
||||
// }
|
||||
// }
|
||||
|
||||
// #[repr(transparent)]
|
||||
// struct Item<T: ?Sized>(<T as IsSized>::SizedRepr);
|
||||
|
||||
// impl<T: ?Sized> Item<T> {
|
||||
// fn from_box(v: Box<T>) -> Self {
|
||||
// let ret = if T::is_sized() {
|
||||
// // SAFETY: #[repr(transparent)], and we know its `SizedRepr` is just `T`
|
||||
// unsafe { (&*v as *const _ as *const Self).read() }
|
||||
// let ptr = Box::into_raw(v);
|
||||
// unsafe { dealloc(ptr.cast(), Layout::for_value_raw(ptr)) }
|
||||
// } else {
|
||||
// // SAFETY: #[repr(transparent)], and we know its `SizedRepr` is `Box<T>`
|
||||
// unsafe { (&v as *const _ as *const Self).read() }
|
||||
// mem::forget(v);
|
||||
// };
|
||||
|
||||
// ret
|
||||
// }
|
||||
// }
|
||||
|
||||
// #[test]
|
||||
// pub fn testing() {
|
||||
// dbg!(usize::is_sized());
|
||||
// dbg!(<dyn Debug>::is_sized());
|
||||
// }
|
||||
|
|
@ -117,9 +117,6 @@
|
|||
//! [`unsize_stable`]: Vec::unsize_stable
|
||||
|
||||
#![cfg_attr(feature = "unstable", feature(coerce_unsized))]
|
||||
// for `mod bad_things`, still a wip
|
||||
// #![allow(incomplete_features)]
|
||||
// #![feature(specialization)]
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![warn(clippy::pedantic)]
|
||||
|
@ -155,7 +152,6 @@ type Coercer<T, U> = for<'a> fn(&'a T) -> &'a U;
|
|||
mod ptr_ext;
|
||||
#[allow(clippy::wildcard_imports)]
|
||||
use ptr_ext::*;
|
||||
mod bad_things;
|
||||
|
||||
/// A heap allocated, dynamic length collection of `?Sized` elements.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue