Skip to content

Commit

Permalink
fix tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
mammothbane committed Sep 19, 2024
1 parent 9ac23f5 commit 8233cf9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,48 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] {
let mut _0: &[u8];
scope 1 (inlined <Vec<u8> as Deref>::deref) {
debug self => _1;
let mut _6: usize;
scope 2 (inlined Vec::<u8>::as_ptr) {
scope 2 (inlined Vec::<u8>::as_slice) {
debug self => _1;
let mut _2: &alloc::raw_vec::RawVec<u8>;
scope 3 (inlined alloc::raw_vec::RawVec::<u8>::ptr) {
debug self => _2;
let mut _3: &alloc::raw_vec::RawVecInner;
scope 4 (inlined alloc::raw_vec::RawVecInner::ptr::<u8>) {
debug self => _3;
scope 5 (inlined alloc::raw_vec::RawVecInner::non_null::<u8>) {
let mut _6: usize;
scope 3 (inlined Vec::<u8>::as_ptr) {
debug self => _1;
let mut _2: &alloc::raw_vec::RawVec<u8>;
scope 4 (inlined alloc::raw_vec::RawVec::<u8>::ptr) {
debug self => _2;
let mut _3: &alloc::raw_vec::RawVecInner;
scope 5 (inlined alloc::raw_vec::RawVecInner::ptr::<u8>) {
debug self => _3;
let mut _4: std::ptr::NonNull<u8>;
scope 6 (inlined Unique::<u8>::cast::<u8>) {
scope 6 (inlined Unique::<u8>::as_ptr) {
debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
scope 7 (inlined NonNull::<u8>::cast::<u8>) {
scope 7 (inlined NonNull::<u8>::as_ptr) {
debug self => _4;
scope 8 (inlined NonNull::<u8>::as_ptr) {
debug self => _4;
let mut _5: *const u8;
}
}
}
scope 9 (inlined #[track_caller] <Unique<u8> as Into<NonNull<u8>>>::into) {
debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
scope 10 (inlined <NonNull<u8> as From<Unique<u8>>>::from) {
debug ((unique: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((unique: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
scope 11 (inlined Unique::<u8>::as_non_null_ptr) {
debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
}
let mut _5: *const u8;
}
}
}
scope 12 (inlined NonNull::<u8>::as_ptr) {
debug self => _4;
}
}
}
}
scope 13 (inlined std::slice::from_raw_parts::<'_, u8>) {
debug data => _5;
debug len => _6;
let _7: *const [u8];
scope 14 (inlined core::ub_checks::check_language_ub) {
scope 15 (inlined core::ub_checks::check_language_ub::runtime) {
}
}
scope 16 (inlined std::mem::size_of::<u8>) {
}
scope 17 (inlined align_of::<u8>) {
}
scope 18 (inlined slice_from_raw_parts::<u8>) {
scope 8 (inlined std::slice::from_raw_parts::<'_, u8>) {
debug data => _5;
debug len => _6;
scope 19 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
debug data_pointer => _5;
debug metadata => _6;
let _7: *const [u8];
scope 9 (inlined core::ub_checks::check_language_ub) {
scope 10 (inlined core::ub_checks::check_language_ub::runtime) {
}
}
scope 11 (inlined std::mem::size_of::<u8>) {
}
scope 12 (inlined align_of::<u8>) {
}
scope 13 (inlined slice_from_raw_parts::<u8>) {
debug data => _5;
debug len => _6;
scope 14 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
debug data_pointer => _5;
debug metadata => _6;
}
}
}
}
Expand All @@ -75,8 +57,10 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] {
_2 = &((*_1).0: alloc::raw_vec::RawVec<u8>);
StorageLive(_3);
_3 = &(((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner);
StorageLive(_4);
_4 = copy (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
_5 = copy (_4.0: *const u8);
StorageDead(_4);
StorageDead(_3);
StorageDead(_2);
StorageLive(_6);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,48 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] {
let mut _0: &[u8];
scope 1 (inlined <Vec<u8> as Deref>::deref) {
debug self => _1;
let mut _6: usize;
scope 2 (inlined Vec::<u8>::as_ptr) {
scope 2 (inlined Vec::<u8>::as_slice) {
debug self => _1;
let mut _2: &alloc::raw_vec::RawVec<u8>;
scope 3 (inlined alloc::raw_vec::RawVec::<u8>::ptr) {
debug self => _2;
let mut _3: &alloc::raw_vec::RawVecInner;
scope 4 (inlined alloc::raw_vec::RawVecInner::ptr::<u8>) {
debug self => _3;
scope 5 (inlined alloc::raw_vec::RawVecInner::non_null::<u8>) {
let mut _6: usize;
scope 3 (inlined Vec::<u8>::as_ptr) {
debug self => _1;
let mut _2: &alloc::raw_vec::RawVec<u8>;
scope 4 (inlined alloc::raw_vec::RawVec::<u8>::ptr) {
debug self => _2;
let mut _3: &alloc::raw_vec::RawVecInner;
scope 5 (inlined alloc::raw_vec::RawVecInner::ptr::<u8>) {
debug self => _3;
let mut _4: std::ptr::NonNull<u8>;
scope 6 (inlined Unique::<u8>::cast::<u8>) {
scope 6 (inlined Unique::<u8>::as_ptr) {
debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
scope 7 (inlined NonNull::<u8>::cast::<u8>) {
scope 7 (inlined NonNull::<u8>::as_ptr) {
debug self => _4;
scope 8 (inlined NonNull::<u8>::as_ptr) {
debug self => _4;
let mut _5: *const u8;
}
}
}
scope 9 (inlined #[track_caller] <Unique<u8> as Into<NonNull<u8>>>::into) {
debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
scope 10 (inlined <NonNull<u8> as From<Unique<u8>>>::from) {
debug ((unique: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((unique: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
scope 11 (inlined Unique::<u8>::as_non_null_ptr) {
debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
}
let mut _5: *const u8;
}
}
}
scope 12 (inlined NonNull::<u8>::as_ptr) {
debug self => _4;
}
}
}
}
scope 13 (inlined std::slice::from_raw_parts::<'_, u8>) {
debug data => _5;
debug len => _6;
let _7: *const [u8];
scope 14 (inlined core::ub_checks::check_language_ub) {
scope 15 (inlined core::ub_checks::check_language_ub::runtime) {
}
}
scope 16 (inlined std::mem::size_of::<u8>) {
}
scope 17 (inlined align_of::<u8>) {
}
scope 18 (inlined slice_from_raw_parts::<u8>) {
scope 8 (inlined std::slice::from_raw_parts::<'_, u8>) {
debug data => _5;
debug len => _6;
scope 19 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
debug data_pointer => _5;
debug metadata => _6;
let _7: *const [u8];
scope 9 (inlined core::ub_checks::check_language_ub) {
scope 10 (inlined core::ub_checks::check_language_ub::runtime) {
}
}
scope 11 (inlined std::mem::size_of::<u8>) {
}
scope 12 (inlined align_of::<u8>) {
}
scope 13 (inlined slice_from_raw_parts::<u8>) {
debug data => _5;
debug len => _6;
scope 14 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
debug data_pointer => _5;
debug metadata => _6;
}
}
}
}
Expand All @@ -75,8 +57,10 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] {
_2 = &((*_1).0: alloc::raw_vec::RawVec<u8>);
StorageLive(_3);
_3 = &(((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner);
StorageLive(_4);
_4 = copy (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
_5 = copy (_4.0: *const u8);
StorageDead(_4);
StorageDead(_3);
StorageDead(_2);
StorageLive(_6);
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/issue-94675.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ known-bug: #103507

#![feature(const_trait_impl)]
#![feature(const_trait_impl, const_vec_string_slice)]

struct Foo<'a> {
bar: &'a mut Vec<usize>,
Expand Down

0 comments on commit 8233cf9

Please sign in to comment.