Compare commits

...

2 commits

Author SHA1 Message Date
missing 17516e3b50 remove some #[allow(s 2022-06-09 21:00:24 -05:00
missing 9f86e3e85f remove bad_things.rs 2022-06-09 20:53:55 -05:00
4 changed files with 6 additions and 61 deletions

View file

@ -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());
// }

View file

@ -1,9 +1,8 @@
//! Implements `Debug`, and `PartialEq` for various list-like types.
#[allow(clippy::wildcard_imports)]
use super::*;
use crate::{Vec, Extra};
use std::{fmt::Debug, ops::{Deref, DerefMut}, vec::Vec as StdVec};
use std::{fmt::Debug, ops::{Deref, DerefMut}, vec::Vec as StdVec, slice, mem::size_of};
impl<T: ?Sized> Default for Vec<T> {
fn default() -> Self {

View file

@ -1,7 +1,8 @@
//! Iteration.
#[allow(clippy::wildcard_imports)]
use super::*;
use std::{marker::PhantomData, mem, ptr::NonNull};
use crate::{Vec, ptr_ext::PtrExt};
struct BaseIter<T: ?Sized> {
ptr: *const *mut T,

View file

@ -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)]
@ -153,9 +150,7 @@ use std::ops::CoerceUnsized;
type Coercer<T, U> = for<'a> fn(&'a T) -> &'a U;
mod ptr_ext;
#[allow(clippy::wildcard_imports)]
use ptr_ext::*;
mod bad_things;
use ptr_ext::{PtrExt, ConstPtrExt, MutPtrExt};
/// A heap allocated, dynamic length collection of `?Sized` elements.
///