File tree Expand file tree Collapse file tree 11 files changed +18
-20
lines changed Expand file tree Collapse file tree 11 files changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ use project1::test::tree;
2020use project1::test::fixed_point;
2121use project1::tmod2::test_mod_impl;
2222use pl_test::main;
23-
2423pub fn main() i64 {
2524 macros::test_macros();
2625 ifel::test_if_else();
Original file line number Diff line number Diff line change 11use project1::mod2;
22pub fn test_mod(args: i64) void {
3- let d:mod2::Mod2 = mod2::Mod2{ };
3+ let d: mod2::Mod2 = mod2::Mod2{};
44 printi64ln(999999);
55 return;
66}
Original file line number Diff line number Diff line change @@ -7,9 +7,8 @@ pub fn test_if_else() void {
77 return;
88}
99
10-
1110fn test_not_equal() void {
12- if 1 !=2 {
11+ if 1 != 2 {
1312 return;
1413 }
1514 return;
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ trait B {
66
77}
88
9-
109trait C: A+B {
1110 fn c() void;
11+
1212}
1313
1414pub fn test_multi_trait() void {
@@ -23,15 +23,13 @@ pub fn test_multi_trait() void {
2323 return;
2424}
2525
26-
2726impl C for test_struct {
2827 fn c() void {
2928 return;
3029 }
3130
3231}
3332
34-
3533impl B for test_struct {
3634 fn b() i64 {
3735 return 1000;
Original file line number Diff line number Diff line change 11pub struct test_struct {
2- }
2+ }
3+
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ pub fn ret_struct() struct_child {
3636}
3737
3838pub fn dangling() *pointer_struct {
39- let a:pointer_struct = pointer_struct{
39+ let a: pointer_struct = pointer_struct{
4040 ptr: &struct_child{
4141 a: 10
4242 }
Original file line number Diff line number Diff line change @@ -3,14 +3,13 @@ struct Node {
33 right: Option<*Node>;
44}
55
6-
76fn build_tree() Node {
87 let n = &Node{};
98 let orin = n;
109 for let i = 0; i < 10; i = i + 1 {
1110 n.left = &Node{};
1211 n.right = &Node{};
13- if i - i/2* 2 == 1 {
12+ if i - i / 2 * 2 == 1 {
1413 n.left = &Node{};
1514 n = n.left as *Node!;
1615 } else {
@@ -20,7 +19,7 @@ fn build_tree() Node {
2019 }
2120 n = orin;
2221 for let i = 0; i < 10; i = i + 1 {
23- if i - i/2* 2 == 1 {
22+ if i - i / 2 * 2 == 1 {
2423 n = n.left as *Node!;
2524 } else {
2625 n = n.right as *Node!;
@@ -37,11 +36,12 @@ fn build_tree() Node {
3736pub fn test_eva() void {
3837 let n = build_tree();
3938 for let i = 0; i < 10; i = i + 1 {
40- if i - i/2* 2 == 1 {
39+ if i - i / 2 * 2 == 1 {
4140 n = *n.left as *Node!;
4241 } else {
4342 n = *n.right as *Node!;
4443 }
4544 }
4645 return;
4746}
47+
Original file line number Diff line number Diff line change @@ -50,5 +50,4 @@ impl<T> A<T> {
5050
5151}
5252
53-
5453type Name = i32 | i64;
Original file line number Diff line number Diff line change 11pub struct name<TT> {
2-
3- }
2+ }
3+
Original file line number Diff line number Diff line change 11use project1::tmod;
22pub trait namet {
33 fn namet() void;
4+
45}
56
6- impl <T> namet for tmod::name<T> {
7+ impl<T> namet for tmod::name<T> {
78 fn namet() void {
89 return;
910 }
11+
1012}
1113
1214// TODO
1315impl tmod::name<T> {
14-
1516}
1617
1718impl namet for i64 {
1819 fn namet() void {
1920 return;
2021 }
21- }
22+
23+ }
24+
You can’t perform that action at this time.
0 commit comments