Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- struct S; impl<T> std::cmp::PartialEq<S> for T { fn eq(&self, _: &S) -> bool { true } } 5_usize == S
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
- --> src/main.rs:6:19
- |
- 6 | struct S; impl<T> std::cmp::PartialEq<S> for T { fn eq(&self, _: &S) -> bool { true } } 5_usize == S
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
- |
- = note: only traits defined in the current crate can be implemented for a type parameter
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0210`.
- 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