Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- struct S; impl std::cmp::PartialEq<S> for usize { fn eq(self, _: usize) -> bool { true } }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0053]: method `eq` has an incompatible type for trait
- --> src/main.rs:6:59
- |
- 6 | struct S; impl std::cmp::PartialEq<S> for usize { fn eq(self, _: usize) -> bool { true } }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &usize, found usize
- |
- = note: expected type `fn(&usize, &main::S) -> bool`
- found type `fn(usize, usize) -> bool`
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0053`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement