about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2019-11-20 17:15:42 -0500
committerAaron Hill <aa1ronham@gmail.com>2019-11-28 13:52:08 -0500
commit79fcaf8f12017fed25cb8f8f077a762408af8c9c (patch)
treea6b29ef0e25124318843c499e47cc690854e444a /src/test
parentb9cf5417892ef242c783ef963deff5436205b0f6 (diff)
downloadrust-79fcaf8f12017fed25cb8f8f077a762408af8c9c.tar.gz
rust-79fcaf8f12017fed25cb8f8f077a762408af8c9c.zip
Apply proper commit from PR #63934
While working on PR #63934, I accidentally reverted to an older version
of the PR while working on a rebase. The PR was then merged, not with
the later, approved changes, but with earlier, unapproved changes.

This PR applies the changes that were *suppoesd* to be mereged in
PR #63934. All of the proper tests appear to have been merged
in PR #63934, so this PR adds no new tests

Fixes #66580
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs b/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs
new file mode 100644
index 00000000000..1d95cc7530c
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs
@@ -0,0 +1,19 @@
+// Regression test for issue #66580
+// Ensures that we don't try to determine whether a closure
+// is foreign when it's the underlying type of an opaque type
+// check-pass
+#![feature(type_alias_impl_trait)]
+
+type Closure = impl FnOnce();
+
+fn closure() -> Closure {
+    || {}
+}
+
+struct Wrap<T> { f: T }
+
+impl Wrap<Closure> {}
+
+impl<T> Wrap<T> {}
+
+fn main() {}