We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fe106d commit 2b3e882Copy full SHA for 2b3e882
[refs]
@@ -1,5 +1,5 @@
1
---
2
-refs/heads/master: 9e1c9be16f9140e09f26de947fddf806c27a957f
+refs/heads/master: 976e1ced0037d88bcd0f32d6e831125b7710a73a
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
trunk/src/test/run-pass/generic-object.rs
@@ -0,0 +1,20 @@
+trait Foo<T> {
+ fn get() -> T;
+}
+
+struct S {
6
+ x: int
7
8
9
+impl S : Foo<int> {
10
+ fn get() -> int {
11
+ self.x
12
+ }
13
14
15
+fn main() {
16
+ let x = @S { x: 1 };
17
+ let y = x as @Foo<int>;
18
+ assert y.get() == 1;
19
20
0 commit comments