Skip to content

Commit d98958c

Browse files
Fix ci
1 parent e53426a commit d98958c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

.github/workflows/actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Rust toolchain
2222
uses: dtolnay/rust-toolchain@stable
2323
with:
24-
components: clippy, rustfmt
24+
components: clippy, miri, rustfmt
2525
target: x86_64-unknown-linux-gnu
2626
toolchain: nightly
2727

emplacable/src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ impl<'s> IntoEmplacable<str> for &'s str {
813813
ptr::copy_nonoverlapping(
814814
addr_of!(*self).cast::<u8>(),
815815
out_ptr.cast(),
816-
self.len(),
816+
layout.size(),
817817
);
818818
}
819819
}
@@ -843,15 +843,14 @@ impl<'s> IntoEmplacable<CStr> for &'s CStr {
843843
let closure = move |emplacer: &mut Emplacer<CStr>| {
844844
// Safety: we call the closure right after
845845
let emplacer_closure = unsafe { emplacer.into_fn() };
846-
let size_of_val = layout.size();
847846
emplacer_closure(layout, metadata, &mut |out_ptr| {
848847
if !out_ptr.is_null() {
849848
// SAFETY: copying value where it belongs.
850849
unsafe {
851850
ptr::copy_nonoverlapping(
852851
addr_of!(*self).cast::<u8>(),
853852
out_ptr.cast(),
854-
size_of_val,
853+
layout.size(),
855854
);
856855
}
857856
}
@@ -883,7 +882,6 @@ impl<'s> IntoEmplacable<OsStr> for &'s OsStr {
883882
let closure = move |emplacer: &mut Emplacer<OsStr>| {
884883
// Safety: we call the closure right after
885884
let emplacer_closure = unsafe { emplacer.into_fn() };
886-
let size_of_val = layout.size();
887885
emplacer_closure(layout, metadata, &mut |out_ptr| {
888886
if !out_ptr.is_null() {
889887
// SAFETY: copying value where it belongs.
@@ -893,7 +891,7 @@ impl<'s> IntoEmplacable<OsStr> for &'s OsStr {
893891
ptr::copy_nonoverlapping(
894892
addr_of!(*self).cast::<u8>(),
895893
out_ptr.cast(),
896-
size_of_val,
894+
layout.size(),
897895
);
898896
}
899897
}
@@ -926,7 +924,6 @@ impl<'s> IntoEmplacable<Path> for &'s Path {
926924
let closure = move |emplacer: &mut Emplacer<Path>| {
927925
// Safety: we call the closure right after
928926
let emplacer_closure = unsafe { emplacer.into_fn() };
929-
let size_of_val = layout.size();
930927
emplacer_closure(layout, metadata, &mut |out_ptr| {
931928
if !out_ptr.is_null() {
932929
// SAFETY: copying value where it belongs.
@@ -936,7 +933,7 @@ impl<'s> IntoEmplacable<Path> for &'s Path {
936933
ptr::copy_nonoverlapping(
937934
addr_of!(*self).cast::<u8>(),
938935
out_ptr.cast(),
939-
size_of_val,
936+
layout.size(),
940937
);
941938
}
942939
}

0 commit comments

Comments
 (0)