2021-05-08 19:56:59 -05:00
|
|
|
trait Hello {
|
2024-04-05 18:27:58 -05:00
|
|
|
fn example(&self, input: &i32);
|
2021-05-08 19:56:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Test1(i32);
|
|
|
|
|
|
|
|
impl Hello for Test1 {
|
2024-04-05 18:27:58 -05:00
|
|
|
fn example(&self, input: &i32) {
|
2021-05-10 23:20:43 -05:00
|
|
|
*input = self.0; //~ ERROR cannot assign
|
2021-05-08 19:56:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Test2(i32);
|
|
|
|
|
|
|
|
impl Hello for Test2 {
|
2024-04-05 18:27:58 -05:00
|
|
|
fn example(&self, input: &i32) {
|
2021-05-10 23:20:43 -05:00
|
|
|
self.0 += *input; //~ ERROR cannot assign
|
2021-05-08 19:56:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|