Skip to content

Commit a6becd8

Browse files
committed
Update tests
1 parent 2d5b6f2 commit a6becd8

6 files changed

Lines changed: 28 additions & 29 deletions

File tree

‎tests/ub/out/refcount/ctor_ref_member.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ pub fn main() {
2323
std::process::exit(main_0());
2424
}
2525
fn main_0() -> i32 {
26-
let s: Value<S> = Rc::new(RefCell::new(S::new({
26+
let s: Value<S> = Rc::new(RefCell::new({
2727
let __tmp_0: Value<i32> = Rc::new(RefCell::new(5));
28-
__tmp_0.as_pointer()
29-
})));
28+
S::new({ __tmp_0.as_pointer() })
29+
}));
3030
assert!((((*s.borrow()).r.read()) == 5));
3131
return 0;
3232
}

‎tests/ub/out/unsafe/ctor_ref_member.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ pub fn main() {
2424
}
2525
}
2626
unsafe fn main_0() -> i32 {
27-
let mut s: S = S::new({
27+
let mut s: S = {
2828
let mut __tmp_0: i32 = 5;
29-
&mut __tmp_0
30-
});
29+
S::new({ &mut __tmp_0 })
30+
};
3131
assert!(((*s.r) == (5)));
3232
return 0;
3333
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,9 @@ fn main_0() -> i32 {
603603
let bufs: Value<Vec<Buffer>> = Rc::new(RefCell::new(Vec::new()));
604604
(*bufs.borrow_mut()).push(Buffer::Buffer_pmutBuffer_rv({ r.as_pointer() }));
605605
{
606-
let __arg =
606+
let __init =
607607
Buffer::Buffer_pmutBuffer_rv({ (bufs.as_pointer() as Ptr<Buffer>).offset(0_usize) });
608-
bufs.as_pointer()
609-
.with_mut(|__v: &mut Vec<Buffer>| __v.push(__arg))
608+
(*bufs.borrow_mut()).push(__init)
610609
};
611610
assert!(
612611
(((*(*(bufs.as_pointer() as Ptr<Buffer>)

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,15 @@ pub struct Pair {
190190
pub second: Value<i32>,
191191
}
192192
impl Pair {
193-
pub fn Pair1() -> Self {
193+
pub fn new_1() -> Self {
194194
let __this: Value<Pair> = Rc::new(RefCell::new(Self {
195195
first: Rc::new(RefCell::new(-1_i32)),
196196
second: Rc::new(RefCell::new(-1_i32)),
197197
}));
198198
let this: Ptr<Pair> = __this.as_pointer();
199199
Rc::try_unwrap(__this).ok().unwrap().into_inner()
200200
}
201-
pub fn Pair2(a: i32) -> Self {
201+
pub fn new_2(a: i32) -> Self {
202202
let a: Value<i32> = Rc::new(RefCell::new(a));
203203
let __this: Value<Pair> = Rc::new(RefCell::new(Self {
204204
first: Rc::new(RefCell::new((*a.borrow()))),
@@ -207,7 +207,7 @@ impl Pair {
207207
let this: Ptr<Pair> = __this.as_pointer();
208208
Rc::try_unwrap(__this).ok().unwrap().into_inner()
209209
}
210-
pub fn Pair3(a: i32, b: i32) -> Self {
210+
pub fn new_3(a: i32, b: i32) -> Self {
211211
let a: Value<i32> = Rc::new(RefCell::new(a));
212212
let b: Value<i32> = Rc::new(RefCell::new(b));
213213
let __this: Value<Pair> = Rc::new(RefCell::new(Self {
@@ -230,7 +230,7 @@ impl Clone for Pair {
230230
}
231231
impl Default for Pair {
232232
fn default() -> Self {
233-
{ Pair::Pair1() }
233+
{ Pair::new_1() }
234234
}
235235
}
236236
impl ByteRepr for Pair {
@@ -251,26 +251,26 @@ impl ByteRepr for Pair {
251251
pub fn emplace_ctor_args_7(pairs: Ptr<Vec<Pair>>) {
252252
let pairs: Value<Ptr<Vec<Pair>>> = Rc::new(RefCell::new(pairs));
253253
{
254-
let __init = Pair::Pair1();
254+
let __init = Pair::new_1();
255255
(*pairs.borrow()).with_mut(|__v: &mut Vec<Pair>| __v.push(__init))
256256
};
257257
{
258-
let __init = Pair::Pair2({ 3 });
258+
let __init = Pair::new_2({ 3 });
259259
(*pairs.borrow()).with_mut(|__v: &mut Vec<Pair>| __v.push(__init))
260260
};
261261
{
262-
let __init = Pair::Pair3({ 4 }, { 5 });
262+
let __init = Pair::new_3({ 4 }, { 5 });
263263
(*pairs.borrow()).with_mut(|__v: &mut Vec<Pair>| __v.push(__init))
264264
};
265265
}
266266
pub fn emplace_deque_8(queue: Ptr<Vec<Pair>>) {
267267
let queue: Value<Ptr<Vec<Pair>>> = Rc::new(RefCell::new(queue));
268268
{
269-
let __init = Pair::Pair3({ 6 }, { 7 });
269+
let __init = Pair::new_3({ 6 }, { 7 });
270270
(*queue.borrow()).with_mut(|__v: &mut Vec<Pair>| __v.push(__init))
271271
};
272272
{
273-
let __init = Pair::Pair1();
273+
let __init = Pair::new_1();
274274
(*queue.borrow()).with_mut(|__v: &mut Vec<Pair>| __v.push(__init))
275275
};
276276
}

‎tests/unit/out/unsafe/copy_move_defaulted.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ unsafe fn main_0() -> i32 {
367367
let mut bufs: Vec<Buffer> = Vec::new();
368368
bufs.push(Buffer::Buffer_pmutBuffer_rv({ &mut r }));
369369
{
370-
let __arg = Buffer::Buffer_pmutBuffer_rv({ &mut bufs[(0_usize)] });
371-
bufs.push(__arg)
370+
let __init = Buffer::Buffer_pmutBuffer_rv({ &mut bufs[(0_usize)] });
371+
bufs.push(__init)
372372
};
373373
assert!(
374374
(((bufs[(1_usize)].n) == (3)) && ((bufs[(1_usize)].data.len()) == (3_usize)))

‎tests/unit/out/unsafe/push_emplace_back.rs‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,21 @@ pub struct Pair {
8888
pub second: i32,
8989
}
9090
impl Pair {
91-
pub unsafe fn Pair1() -> Self {
91+
pub unsafe fn new_1() -> Self {
9292
let mut this = Self {
9393
first: -1_i32,
9494
second: -1_i32,
9595
};
9696
this
9797
}
98-
pub unsafe fn Pair2(mut a: i32) -> Self {
98+
pub unsafe fn new_2(mut a: i32) -> Self {
9999
let mut this = Self {
100100
first: a,
101101
second: 0,
102102
};
103103
this
104104
}
105-
pub unsafe fn Pair3(mut a: i32, mut b: i32) -> Self {
105+
pub unsafe fn new_3(mut a: i32, mut b: i32) -> Self {
106106
let mut this = Self {
107107
first: a,
108108
second: ((b) * (2)),
@@ -112,30 +112,30 @@ impl Pair {
112112
}
113113
impl Default for Pair {
114114
fn default() -> Self {
115-
unsafe { Pair::Pair1() }
115+
unsafe { Pair::new_1() }
116116
}
117117
}
118118
pub unsafe fn emplace_ctor_args_7(mut pairs: *mut Vec<Pair>) {
119119
{
120-
let __init = Pair::Pair1();
120+
let __init = Pair::new_1();
121121
(*pairs).push(__init)
122122
};
123123
{
124-
let __init = Pair::Pair2({ 3 });
124+
let __init = Pair::new_2({ 3 });
125125
(*pairs).push(__init)
126126
};
127127
{
128-
let __init = Pair::Pair3({ 4 }, { 5 });
128+
let __init = Pair::new_3({ 4 }, { 5 });
129129
(*pairs).push(__init)
130130
};
131131
}
132132
pub unsafe fn emplace_deque_8(mut queue: *mut Vec<Pair>) {
133133
{
134-
let __init = Pair::Pair3({ 6 }, { 7 });
134+
let __init = Pair::new_3({ 6 }, { 7 });
135135
(*queue).push(__init)
136136
};
137137
{
138-
let __init = Pair::Pair1();
138+
let __init = Pair::new_1();
139139
(*queue).push(__init)
140140
};
141141
}

0 commit comments

Comments
 (0)