Skip to content

Commit 6701755

Browse files
committed
temporary patch to work around UB in a test
1 parent 53f294d commit 6701755

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

rust-src.diff

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/library/alloc/tests/arc.rs b/library/alloc/tests/arc.rs
2+
index eb379e4d6a1..9191fa95150 100644
3+
--- a/library/alloc/tests/arc.rs
4+
+++ b/library/alloc/tests/arc.rs
5+
@@ -212,6 +212,7 @@ fn hmm<'a>(val: &'a mut Weak<&'a str>) -> Weak<&'a str> {
6+
}
7+
8+
#[test]
9+
+#[cfg_attr(miri, ignore)] // test has UB (https://github.com/rust-lang/rust/issues/104565)
10+
fn arc_from_vec_opt() {
11+
let mut v = Vec::with_capacity(64);
12+
v.push(0usize);
13+
diff --git a/library/alloc/tests/rc.rs b/library/alloc/tests/rc.rs
14+
index 1d5f3c52006..0a19162a402 100644
15+
--- a/library/alloc/tests/rc.rs
16+
+++ b/library/alloc/tests/rc.rs
17+
@@ -208,6 +208,7 @@ fn hmm<'a>(val: &'a mut Weak<&'a str>) -> Weak<&'a str> {
18+
}
19+
20+
#[test]
21+
+#[cfg_attr(miri, ignore)] // test has UB (https://github.com/rust-lang/rust/issues/104565)
22+
fn rc_from_vec_opt() {
23+
let mut v = Vec::with_capacity(64);
24+
v.push(0usize);

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2022-11-17
1+
nightly-2022-11-19

0 commit comments

Comments
 (0)