Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- struct Foo(String); impl Deref for Foo { type Target = String; fn deref(&self) -> &Self::Target { &self.0 } } fn x(_y: &str) {} x(&Foo(String::new()));
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0405]: cannot find trait `Deref` in this scope
- --> src/main.rs:6:34
- |
- 6 | struct Foo(String); impl Deref for Foo { type Target = String; fn deref(&self) -> &Self::Target { &self.0 } } fn x(_y: &str) {} x(&Foo(String::new()));
- | ^^^^^ not found in this scope
- help: possible candidates are found in other modules, you can import them into scope
- |
- 4 | use core::ops::Deref;
- |
- 4 | use std::ops::Deref;
- |
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0405`.
- 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