Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- use ::std::borrow::Cow; fn check<'a, T: Into<Cow<'a, Vec<i32>>>>(owned_or_borrowed: T) -> Vec<i32> { owned_or_borrowed.into().into_owned() } check(&[])
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0277]: the trait bound `std::borrow::Cow<'_, std::vec::Vec<i32>>: std::convert::From<&[_; 0]>` is not satisfied
- --> src/main.rs:5:150
- |
- 5 | use ::std::borrow::Cow; fn check<'a, T: Into<Cow<'a, Vec<i32>>>>(owned_or_borrowed: T) -> Vec<i32> { owned_or_borrowed.into().into_owned() } check(&[])
- | ^^^^^ the trait `std::convert::From<&[_; 0]>` is not implemented for `std::borrow::Cow<'_, std::vec::Vec<i32>>`
- |
- = help: the following implementations were found:
- <std::borrow::Cow<'a, std::path::Path> as std::convert::From<std::path::PathBuf>>
- <std::borrow::Cow<'a, std::path::Path> as std::convert::From<&'a std::path::Path>>
- <std::borrow::Cow<'a, str> as std::convert::From<std::string::String>>
- <std::borrow::Cow<'a, [T]> as std::convert::From<std::vec::Vec<T>>>
- and 2 others
- = note: required because of the requirements on the impl of `std::convert::Into<std::borrow::Cow<'_, std::vec::Vec<i32>>>` for `&[_; 0]`
- note: required by `main::check`
- --> src/main.rs:5:33
- |
- 5 | use ::std::borrow::Cow; fn check<'a, T: Into<Cow<'a, Vec<i32>>>>(owned_or_borrowed: T) -> Vec<i32> { owned_or_borrowed.into().into_owned() } check(&[])
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0277`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment