Skip to content

Commit ebc7a92

Browse files
committed
fix: rust0 didnt compile
1 parent befee27 commit ebc7a92

File tree

1 file changed

+12
-10
lines changed
  • testdata/rust/0_rust2/src/entity

1 file changed

+12
-10
lines changed

testdata/rust/0_rust2/src/entity/inter.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,25 @@ pub trait Addable {
1919

2020
pub struct AnyInt(i64);
2121

22-
//impl AnyInt {
23-
// pub fn id() -> i64 {
24-
// 0
25-
// }
26-
// pub fn add(&self, b: i64) -> i64 {
27-
// self.0 + b
28-
// }
29-
//}
22+
impl AnyInt {
23+
//pub fn id() -> i64 {
24+
pub fn idx() -> i64 {
25+
0
26+
}
27+
//pub fn add(&self, b: i64) -> i64 {
28+
pub fn addx(&self, b: i64) -> i64 {
29+
self.0 + b
30+
}
31+
}
3032

3133
impl Addable for AnyInt {
3234
fn add(&self, b: i64) -> i64 {
3335
// use the method defined in the struct
34-
self.add(b)
36+
self.addx(b)
3537
}
3638
fn id() -> i64 {
3739
// use the method defined in the struct
38-
AnyInt::id()
40+
AnyInt::idx()
3941
}
4042
}
4143

0 commit comments

Comments
 (0)