summaryrefslogtreecommitdiffstats
path: root/tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed')
-rw-r--r--tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed b/tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed
new file mode 100644
index 000000000..892697493
--- /dev/null
+++ b/tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed
@@ -0,0 +1,31 @@
+// run-rustfix
+
+use std::fmt::Debug;
+use std::marker::PhantomData;
+use std::convert::{self, TryFrom};
+
+#[allow(unused)]
+struct Codec<EncodeLine, DecodeLine> {
+ phantom_decode: PhantomData<DecodeLine>,
+ phantom_encode: PhantomData<EncodeLine>,
+}
+
+pub enum ParseError {}
+
+impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
+ DecodeLine: Debug + convert::TryFrom<String>,
+ DecodeLine: convert::TryFrom<String, Error = ParseError>,
+ //~^ ERROR expected trait, found enum `ParseError`
+ //~| HELP constrain the associated type to `ParseError`
+{
+}
+
+impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
+ DecodeLine: Debug + TryFrom<String>,
+ DecodeLine: TryFrom<String, Error = ParseError>,
+ //~^ ERROR expected trait, found enum `ParseError`
+ //~| HELP constrain the associated type to `ParseError`
+{
+}
+
+fn main() {}