File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change
1
+ diff --git a/library/core/tests/mem.rs b/library/core/tests/mem.rs
2
+ index 5e24fa690ef52..5d0fedd4d9ccc 100644
3
+ --- a/library/core/tests/mem.rs
4
+ +++ b/library/core/tests/mem.rs
5
+ @@ -1,5 +1,6 @@
6
+ use core::mem::*;
7
+
8
+ + #[cfg(panic = "unwind")]
9
+ use std::rc::Rc;
10
+
11
+ #[test]
12
+ @@ -250,14 +251,19 @@ fn uninit_write_slice_cloned_mid_panic() {
13
+
14
+ #[test]
15
+ fn uninit_write_slice_cloned_no_drop() {
16
+ - let rc = Rc::new(());
17
+ + #[derive(Clone)]
18
+ + struct Bomb;
19
+ +
20
+ + impl Drop for Bomb {
21
+ + fn drop(&mut self) {
22
+ + panic!("dropped a bomb! kaboom")
23
+ + }
24
+ + }
25
+
26
+ let mut dst = [MaybeUninit::uninit()];
27
+ - let src = [rc.clone()];
28
+ + let src = [Bomb];
29
+
30
+ MaybeUninit::write_slice_cloned(&mut dst, &src);
31
+
32
+ - drop(src);
33
+ -
34
+ - assert_eq!(Rc::strong_count(&rc), 2);
35
+ + forget(src);
36
+ }
Original file line number Diff line number Diff line change 1
- nightly-2020-11-30
1
+ nightly-2020-12-19
You can’t perform that action at this time.
0 commit comments