Skip to content

Commit d9d2a77

Browse files
committed
---
yaml --- r: 13299 b: refs/heads/master c: 83d290f h: refs/heads/master i: 13297: 9efd9dc 13295: 2f64b4a v: v3
1 parent 7156c5c commit d9d2a77

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 60913bf04590e0cb6d80290b0e15b00046dfaeaa
2+
refs/heads/master: 83d290f461c8cf3fe65e682162f3acd4a6369478
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/sys.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ enum type_desc = {
1717

1818
#[abi = "cdecl"]
1919
native mod rustrt {
20-
fn refcount(t: *()) -> libc::intptr_t;
20+
pure fn refcount(t: *()) -> libc::intptr_t;
2121
fn unsupervise();
22-
fn shape_log_str(t: *sys::type_desc, data: *()) -> str;
22+
pure fn shape_log_str(t: *sys::type_desc, data: *()) -> str;
2323
}
2424

2525
#[abi = "rust-intrinsic"]
@@ -36,13 +36,13 @@ Returns a pointer to a type descriptor.
3636
Useful for calling certain function in the Rust runtime or otherwise
3737
performing dark magick.
3838
"]
39-
fn get_type_desc<T>() -> *type_desc {
40-
rusti::get_tydesc::<T>() as *type_desc
39+
pure fn get_type_desc<T>() -> *type_desc {
40+
unchecked { rusti::get_tydesc::<T>() as *type_desc }
4141
}
4242

4343
#[doc = "Returns the size of a type"]
44-
fn size_of<T>() -> uint unsafe {
45-
rusti::size_of::<T>()
44+
pure fn size_of<T>() -> uint unsafe {
45+
unchecked { rusti::size_of::<T>() }
4646
}
4747

4848
#[doc = "
@@ -51,23 +51,23 @@ Returns the ABI-required minimum alignment of a type
5151
This is the alignment used for struct fields. It may be smaller
5252
than the preferred alignment.
5353
"]
54-
fn min_align_of<T>() -> uint unsafe {
55-
rusti::min_align_of::<T>()
54+
pure fn min_align_of<T>() -> uint unsafe {
55+
unchecked { rusti::min_align_of::<T>() }
5656
}
5757

5858
#[doc = "Returns the preferred alignment of a type"]
59-
fn pref_align_of<T>() -> uint unsafe {
60-
rusti::pref_align_of::<T>()
59+
pure fn pref_align_of<T>() -> uint unsafe {
60+
unchecked { rusti::pref_align_of::<T>() }
6161
}
6262

6363
#[doc = "Returns the refcount of a shared box"]
64-
fn refcount<T>(t: @T) -> uint {
64+
pure fn refcount<T>(t: @T) -> uint {
6565
unsafe {
6666
ret rustrt::refcount(unsafe::reinterpret_cast(t)) as uint;
6767
}
6868
}
6969

70-
fn log_str<T>(t: T) -> str {
70+
pure fn log_str<T>(t: T) -> str {
7171
unsafe {
7272
let data_ptr: *() = unsafe::reinterpret_cast(ptr::addr_of(t));
7373
rustrt::shape_log_str(get_type_desc::<T>(), data_ptr)

0 commit comments

Comments
 (0)