summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/issue_4257.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/source/issue_4257.rs')
-rw-r--r--src/tools/rustfmt/tests/source/issue_4257.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue_4257.rs b/src/tools/rustfmt/tests/source/issue_4257.rs
new file mode 100644
index 000000000..2b887fadb
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue_4257.rs
@@ -0,0 +1,13 @@
+#![feature(generic_associated_types)]
+#![allow(incomplete_features)]
+
+trait Trait<T> {
+ type Type<'a> where T: 'a;
+ fn foo(x: &T) -> Self::Type<'_>;
+}
+impl<T> Trait<T> for () {
+ type Type<'a> where T: 'a = &'a T;
+ fn foo(x: &T) -> Self::Type<'_> {
+ x
+ }
+}