Skip to content

Commit cbef948

Browse files
committed
latest Rust needs a patch
1 parent 2b459e8 commit cbef948

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

rust-src.diff

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
}

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2020-11-30
1+
nightly-2020-12-19

0 commit comments

Comments
 (0)