Skip to content

Commit 5a471be

Browse files
committed
Update tests
1 parent d295ff9 commit 5a471be

2 files changed

Lines changed: 7 additions & 19 deletions

File tree

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,8 @@ use std::io::prelude::*;
66
use std::io::{Read, Seek, Write};
77
use std::os::fd::AsFd;
88
use std::rc::{Rc, Weak};
9-
#[derive(Default)]
9+
#[derive(Clone, ByteRepr, Default)]
1010
pub struct Sized {}
11-
impl Clone for Sized {
12-
fn clone(&self) -> Self {
13-
let __this: Value<Sized> = Rc::new(RefCell::new(Self {}));
14-
let this: Ptr<Sized> = __this.as_pointer();
15-
Rc::try_unwrap(__this).ok().unwrap().into_inner()
16-
}
17-
}
18-
impl ByteRepr for Sized {
19-
fn byte_size() -> usize {
20-
1
21-
}
22-
fn to_bytes(&self, buf: &mut [u8]) {}
23-
fn from_bytes(buf: &[u8]) -> Self {
24-
Self {}
25-
}
26-
}
2711
pub fn is_small_0() -> bool {
2812
return true;
2913
}
@@ -58,13 +42,14 @@ pub fn pick_6(x: f32) -> i32 {
5842
return 2;
5943
}
6044
pub fn main() {
45+
__cpp2rust_init_globals();
6146
std::process::exit(main_0());
6247
}
6348
fn main_0() -> i32 {
6449
assert!(({ is_small_0() }));
6550
assert!(!({ is_small_1() }));
6651
assert!(true);
67-
assert!(!false);
52+
assert!(!(false));
6853
assert!(({ has_size_2() }));
6954
assert!(!({ has_size_3() }));
7055
assert!((({ pick_4(1,) }) == 1));
@@ -80,3 +65,4 @@ impl SizedImpl for Ptr<Sized> {
8065
return 4;
8166
}
8267
}
68+
pub fn __cpp2rust_init_globals() {}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,20 @@ pub unsafe fn pick_6(mut x: f32) -> i32 {
4646
}
4747
pub fn main() {
4848
unsafe {
49+
__cpp2rust_init_globals();
4950
std::process::exit(main_0() as i32);
5051
}
5152
}
5253
unsafe fn main_0() -> i32 {
5354
assert!((unsafe { is_small_0() }));
5455
assert!(!(unsafe { is_small_1() }));
5556
assert!(true);
56-
assert!(!false);
57+
assert!(!(false));
5758
assert!((unsafe { has_size_2() }));
5859
assert!(!(unsafe { has_size_3() }));
5960
assert!(((unsafe { pick_4(1,) }) == (1)));
6061
assert!(((unsafe { pick_5(1_i64,) }) == (2)));
6162
assert!(((unsafe { pick_6(1.0E+0,) }) == (2)));
6263
return 0;
6364
}
65+
pub unsafe fn __cpp2rust_init_globals() {}

0 commit comments

Comments
 (0)