From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/ufcs/ufcs-qpath-missing-params.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/ufcs/ufcs-qpath-missing-params.rs (limited to 'tests/ui/ufcs/ufcs-qpath-missing-params.rs') diff --git a/tests/ui/ufcs/ufcs-qpath-missing-params.rs b/tests/ui/ufcs/ufcs-qpath-missing-params.rs new file mode 100644 index 000000000..766351634 --- /dev/null +++ b/tests/ui/ufcs/ufcs-qpath-missing-params.rs @@ -0,0 +1,20 @@ +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() { + ::into_cow("foo".to_string()); + //~^ ERROR missing generics for + + ::into_cow::("foo".to_string()); + //~^ ERROR this associated function takes 0 generic arguments but 1 + //~| ERROR missing generics for +} -- cgit v1.2.3