Skip to content

Commit 10d8a68

Browse files
committed
libcore: Add missing ops.rs
1 parent da80bd1 commit 10d8a68

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

src/libcore/ops.rs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Core operators and kinds.
2+
3+
#[lang="const"]
4+
trait const {
5+
// Empty.
6+
}
7+
8+
#[lang="copy"]
9+
trait copy {
10+
// Empty.
11+
}
12+
13+
#[lang="send"]
14+
trait send {
15+
// Empty.
16+
}
17+
18+
#[lang="owned"]
19+
trait owned {
20+
// Empty.
21+
}
22+
23+
#[lang="add"]
24+
trait add<RHS,Result> {
25+
pure fn add(rhs: RHS) -> Result;
26+
}
27+
28+
#[lang="sub"]
29+
trait sub<RHS,Result> {
30+
pure fn sub(rhs: RHS) -> Result;
31+
}
32+
33+
#[lang="mul"]
34+
trait mul<RHS,Result> {
35+
pure fn mul(rhs: RHS) -> Result;
36+
}
37+
38+
#[lang="div"]
39+
trait div<RHS,Result> {
40+
pure fn div(rhs: RHS) -> Result;
41+
}
42+
43+
#[lang="modulo"]
44+
trait modulo<RHS,Result> {
45+
pure fn modulo(rhs: RHS) -> Result;
46+
}
47+
48+
#[lang="neg"]
49+
trait neg<RHS,Result> {
50+
pure fn neg(rhs: RHS) -> Result;
51+
}
52+
53+
#[lang="bitops"]
54+
trait bitops<RHS,BitCount,Result> {
55+
pure fn and(rhs: RHS) -> Result;
56+
pure fn or(rhs: RHS) -> Result;
57+
pure fn xor(rhs: RHS) -> Result;
58+
pure fn shl(n: BitCount) -> Result;
59+
pure fn shr(n: BitCount) -> Result;
60+
}
61+
62+
#[lang="index"]
63+
trait index<Index,Result> {
64+
pure fn index(index: Index) -> Result;
65+
}
66+

0 commit comments

Comments
 (0)