Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- trait CopyIterator: Iterator where <Self as Iterator>::Item: Copy { fn foo(&self) { } } let iter = vec![1].into_iter(); iter.foo();
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0599]: no method named `foo` found for type `std::vec::IntoIter<{integer}>` in the current scope
- --> src/main.rs:6:134
- |
- 6 | trait CopyIterator: Iterator where <Self as Iterator>::Item: Copy { fn foo(&self) { } } let iter = vec![1].into_iter(); iter.foo();
- | ^^^
- |
- = help: items from traits can only be used if the trait is implemented and in scope
- = note: the following trait defines an item `foo`, perhaps you need to implement it:
- candidate #1: `main::CopyIterator`
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0599`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment