about summary refs log tree commit diff
path: root/tests/ui/impl-trait
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-06-23 22:00:55 +0000
committerMichael Goulet <michael@errs.io>2023-06-27 21:36:15 +0000
commitbfc6ca8207a0fda58a89ee7a9d2d109efdce5ab1 (patch)
treeac7f4284d6a1c14ded7b45d7a43ba0ebe10004e2 /tests/ui/impl-trait
parent75a8f681837c70051e0200a14f58ae07dbe58e66 (diff)
downloadrust-bfc6ca8207a0fda58a89ee7a9d2d109efdce5ab1.tar.gz
rust-bfc6ca8207a0fda58a89ee7a9d2d109efdce5ab1.zip
More tests
Diffstat (limited to 'tests/ui/impl-trait')
-rw-r--r--tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs b/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs
new file mode 100644
index 00000000000..1025c2c7e8a
--- /dev/null
+++ b/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs
@@ -0,0 +1,27 @@
+// build-pass
+// edition:2021
+// compile-flags: -Cdebuginfo=2
+
+// We were not normalizing opaques with escaping bound vars during codegen,
+// leading to later linker errors because of differences in mangled symbol name.
+
+fn func<T>() -> impl Sized {}
+
+trait Trait<'a> {
+    type Assoc;
+
+    fn call() {
+        let _ = async {
+            let _value = func::<Self::Assoc>();
+            std::future::ready(()).await
+        };
+    }
+}
+
+impl Trait<'static> for () {
+    type Assoc = ();
+}
+
+fn main() {
+    <()>::call();
+}