Skip to content

Commit 9c3ffc7

Browse files
committed
fix
1 parent ad4d0be commit 9c3ffc7

86 files changed

Lines changed: 948 additions & 1622 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎rules/vector/tgt_unsafe.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ unsafe fn f13<T1>(a0: &mut Vec<T1>) -> *mut T1 {
8080
a0.as_mut_ptr()
8181
}
8282
unsafe fn f14<T1: Default>(a0: &mut Vec<T1>, a1: &mut T1) {
83-
a0.push(std::mem::take(&mut *a1))
83+
let __a1 = std::mem::take(&mut *a1);
84+
a0.push(__a1)
8485
}
8586
unsafe fn f15<T1: Default>(a0: &mut Vec<T1>, a1: usize) {
8687
let __a0 = a1 as usize;

‎tests/multi-file/defaulted_move_cross_tu/out/refcount/defaulted_move_cross_tu.rs‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,11 @@ impl Default for S {
4747
}
4848
}
4949
}
50-
<<<<<<< HEAD
51-
impl ByteRepr for S {}
52-
=======
5350
impl ByteRepr for S {
5451
fn byte_size() -> usize {
5552
32
5653
}
57-
fn to_bytes(&self, buf: &mut [u8]) {
58-
(*self.v.borrow()).to_bytes(&mut buf[0..24]);
59-
(*self.n.borrow()).to_bytes(&mut buf[24..32]);
60-
}
61-
fn from_bytes(buf: &[u8]) -> Self {
62-
Self {
63-
v: Rc::new(RefCell::new(<Vec<i32>>::from_bytes(&buf[0..24]))),
64-
n: Rc::new(RefCell::new(<Box<[i32]>>::from_bytes(&buf[24..32]))),
65-
}
66-
}
6754
}
68-
>>>>>>> 3ed38b58 (Remove Value<> boxing from struct fields)
6955
pub fn sum_0(s: Ptr<S>) -> i32 {
7056
return {
7157
let _lhs = {

‎tests/multi-file/out_of_line_methods_cross_tu/out/refcount/out_of_line_methods_cross_tu.rs‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,11 @@ pub struct S {
1212
pub v: i32,
1313
}
1414
impl S {}
15-
<<<<<<< HEAD
16-
impl Clone for S {
17-
fn clone(&self) -> Self {
18-
let __this: Value<S> = Rc::new(RefCell::new(Self {
19-
v: Rc::new(RefCell::new((*self.v.borrow()))),
20-
}));
21-
let this: Ptr<S> = __this.as_pointer();
22-
Rc::try_unwrap(__this).ok().unwrap().into_inner()
23-
}
24-
}
25-
impl ByteRepr for S {}
26-
=======
2715
impl ByteRepr for S {
2816
fn byte_size() -> usize {
2917
4
3018
}
31-
fn to_bytes(&self, buf: &mut [u8]) {
32-
self.v.to_bytes(&mut buf[0..4]);
33-
}
34-
fn from_bytes(buf: &[u8]) -> Self {
35-
Self {
36-
v: <i32>::from_bytes(&buf[0..4]),
37-
}
38-
}
3919
}
40-
>>>>>>> 3ed38b58 (Remove Value<> boxing from struct fields)
4120
pub trait Base {
4221
fn apply(&mut self, x: i32) -> i32;
4322
}
@@ -56,23 +35,11 @@ impl Clone for Derived {
5635
Rc::try_unwrap(__this).ok().unwrap().into_inner()
5736
}
5837
}
59-
<<<<<<< HEAD
60-
impl ByteRepr for Derived {}
61-
=======
6238
impl ByteRepr for Derived {
6339
fn byte_size() -> usize {
6440
16
6541
}
66-
fn to_bytes(&self, buf: &mut [u8]) {
67-
self.factor.to_bytes(&mut buf[8..12]);
68-
}
69-
fn from_bytes(buf: &[u8]) -> Self {
70-
Self {
71-
factor: <i32>::from_bytes(&buf[8..12]),
72-
}
73-
}
7442
}
75-
>>>>>>> 3ed38b58 (Remove Value<> boxing from struct fields)
7643
pub fn main() {
7744
__cpp2rust_init_globals();
7845
std::process::exit(main_0());

‎tests/unit/container_field_addr.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// panic: refcount
21
#include <cassert>
32
#include <map>
43
#include <string>

‎tests/unit/field_pointers_malloced_struct.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// panic: refcount
21
#include <cassert>
32
#include <cstdlib>
43

‎tests/unit/first_field_ptr_covers_struct.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// panic: refcount
21
#include <assert.h>
32
#include <stdlib.h>
43
#include <string.h>

‎tests/unit/first_member_downcast.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// panic: refcount
21
#include <assert.h>
32
#include <stdlib.h>
43

‎tests/unit/memset_struct_tail.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// panic: refcount
21
#include <assert.h>
32
#include <stddef.h>
43
#include <stdlib.h>

‎tests/unit/out/refcount/array_of_noncopy_struct.rs‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,11 @@ impl Default for NonCopy {
2929
}
3030
}
3131
}
32-
<<<<<<< HEAD
33-
impl ByteRepr for NonCopy {}
34-
=======
3532
impl ByteRepr for NonCopy {
3633
fn byte_size() -> usize {
3734
32
3835
}
39-
fn to_bytes(&self, buf: &mut [u8]) {
40-
(*self.data.borrow()).to_bytes(&mut buf[0..24]);
41-
self.tag.to_bytes(&mut buf[24..28]);
42-
}
43-
fn from_bytes(buf: &[u8]) -> Self {
44-
Self {
45-
data: Rc::new(RefCell::new(<Vec<i32>>::from_bytes(&buf[0..24]))),
46-
tag: <i32>::from_bytes(&buf[24..28]),
47-
}
48-
}
4936
}
50-
>>>>>>> 3ed38b58 (Remove Value<> boxing from struct fields)
5137
pub fn main() {
5238
__cpp2rust_init_globals();
5339
std::process::exit(main_0());
@@ -59,7 +45,10 @@ fn main_0() -> i32 {
5945
.collect::<Box<[NonCopy]>>(),
6046
));
6147
(*arr.borrow_mut())[(0) as usize].tag = 7;
62-
(*{ (*arr.borrow())[(1) as usize].data.clone() }.borrow_mut()).push(42);
48+
{
49+
let __a1 = 42;
50+
(*{ (*arr.borrow())[(1) as usize].data.clone() }.borrow_mut()).push(__a1)
51+
};
6352
assert!(({ (*arr.borrow())[(0) as usize].tag } == 7));
6453
assert!(((*{ (*arr.borrow())[(1) as usize].data.clone() }.borrow()).len() == 1_usize));
6554
assert!(

‎tests/unit/out/refcount/auto.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ fn main_0() -> i32 {
1515
let x2: Value<i16> = Rc::new(RefCell::new(2_i16));
1616
let x3: Value<u32> = Rc::new(RefCell::new(4_u32));
1717
let v: Value<Vec<i32>> = Rc::new(RefCell::new(Vec::new()));
18-
(*v.borrow_mut()).push(1);
19-
(*v.borrow_mut()).push(2);
18+
{
19+
let __a1 = 1;
20+
(*v.borrow_mut()).push(__a1)
21+
};
22+
{
23+
let __a1 = 2;
24+
(*v.borrow_mut()).push(__a1)
25+
};
2026
let sum: Value<i32> = Rc::new(RefCell::new(0));
2127
'loop_: for mut elem in v.as_pointer() as Ptr<i32> {
2228
let elem: Value<i32> = Rc::new(RefCell::new(elem.read()));

0 commit comments

Comments
 (0)