rust/tests/ui/ufcs/ufcs-qpath-missing-params.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
486 B
Rust
Raw Normal View History

use std::borrow::Cow;
pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
fn into_cow(self) -> Cow<'a, B>;
}
impl<'a> IntoCow<'a, str> for String {
fn into_cow(self) -> Cow<'a, str> {
Cow::Owned(self)
}
}
fn main() {
<String as IntoCow>::into_cow("foo".to_string());
2021-02-18 20:01:44 +00:00
//~^ ERROR missing generics for
<String as IntoCow>::into_cow::<str>("foo".to_string());
//~^ ERROR method takes 0 generic arguments but 1
2021-02-18 20:01:44 +00:00
//~| ERROR missing generics for
}