#prog #rust #suckassstory
trait Trait {Issue
fn abs(self) -> Self;
}
impl Trait for i64 {
fn abs(self) -> Self {
2 * self
}
}
fn main() {
let x = 42;
println!("{}", x.abs()); // 84
println!("{}", x.abs()); // 42
}
GitHub
Surprising non-idempotent behavior on `{integer}` inference + method resolution · Issue #121453 · rust-lang/rust
Excerpt from Zulip (originally https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/Question.20from.20t-spec/near/422487076): trait Trait { fn abs(self) -> Self; } impl Trait for ...
🤯27😱2👍1😢1🥴1😐1
Forwarded from Jokes++
Even if people fail on multiple points, they might still be good enough if there is a good explanation. (e.g. young, out of practice, worked with c++ the last years)
https://twitter.com/vanillacoder/status/1255507493465346048
https://twitter.com/vanillacoder/status/1255507493465346048
X (formerly Twitter)
Моноид-тян 🤔 [email protected] (@vanillacoder) on X
Читаю про собеседования:
>Even if people fail on multiple points, they might still be good enough if there is a good explanation. (e.g. young, out of practice, worked with c++ the last years)
>Even if people fail on multiple points, they might still be good enough if there is a good explanation. (e.g. young, out of practice, worked with c++ the last years)
🤡3💯3😁2