You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::fmt::Debug;//consume xfnconsume_print_return<T>(x:T) -> Twhere// how do I express that these ---*// |// *-----------------------------*// |// *------------------v/* | */for<'a>&'aT:IntoIterator,// *-------------------v/* | */for<'a> <&'aTasIntoIterator>::Item:Debug,// |{/* | */// *--- lifetimes are equal to the lifetime of this borrow?// |// *-----------vfor item in&x {println!("{:?}", item);}//return x
x
}fnmain(){consume_print_return(vec![1,2]);}
Gives the following error
error[E0277]: <&'a _ as std::iter::IntoIterator>::Item doesn't implement std::fmt::Debug
The text was updated successfully, but these errors were encountered:
Gives the following error
error[E0277]:
<&'a _ as std::iter::IntoIterator>::Item
doesn't implementstd::fmt::Debug
The text was updated successfully, but these errors were encountered: