summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs')
-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 000000000..1025c2c7e
--- /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();
+}