Skip to content

Commit 9e973cc

Browse files
committed
---
yaml --- r: 22764 b: refs/heads/master c: 10d8a68 h: refs/heads/master v: v3
1 parent b08ea06 commit 9e973cc

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
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: da80bd17c30db599de43355f07783ee0bf846162
2+
refs/heads/master: 10d8a68791ff2103a84c02783db4e3fd28f2cd87
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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)