Closed
Description
This does not compile, because the open <
is parsed as a comparison operator. Possibly, this is a bug, and it should be parsed as it is intended - opening a type scope. But I don't know.
pub fn stringify<T: ToString>(arg: T) -> String {
return <T as ToString>::to_string(&arg);
}
If the current parse is correct, adding parens should not produce an unused_parens error, because these parens are necessary to make it parse as intended. However, it does:
pub fn stringify<T: ToString>(arg: T) -> String {
return (<T as ToString>::to_string(&arg));
}