about summary refs log tree commit diff
path: root/tests/ui/impl-trait
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-06-30 08:01:14 +0200
committerGitHub <noreply@github.com>2023-06-30 08:01:14 +0200
commit38e6bba9c1c859166bf8a3d77eefb28c5e30329d (patch)
treedd691de801bbe8e2792d98a3af3de7d83793aae1 /tests/ui/impl-trait
parentc8f50ee11170166e86ab9c9b10c208f51ad998a1 (diff)
parenta10406318e0888b1356e88ec8866fe260a55e6aa (diff)
downloadrust-38e6bba9c1c859166bf8a3d77eefb28c5e30329d.tar.gz
rust-38e6bba9c1c859166bf8a3d77eefb28c5e30329d.zip
Rollup merge of #113171 - spastorino:new-rpitit-25, r=compiler-errors
Properly implement variances_of for RPITIT GAT

This fixes some of the issues found by crater run in https://github.com/rust-lang/rust/pull/112988#issuecomment-1610019572

r? ``@compiler-errors``
Diffstat (limited to 'tests/ui/impl-trait')
-rw-r--r--tests/ui/impl-trait/in-trait/variances-of-gat.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-trait/variances-of-gat.rs b/tests/ui/impl-trait/in-trait/variances-of-gat.rs
new file mode 100644
index 00000000000..4008ece94da
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/variances-of-gat.rs
@@ -0,0 +1,19 @@
+// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo {}
+
+impl Foo for () {}
+
+trait ThreeCellFragment {
+    fn ext_cells<'a>(&'a self) -> impl Foo + 'a {
+        self.ext_adjacent_cells()
+    }
+
+    fn ext_adjacent_cells<'a>(&'a self) -> impl Foo + 'a;
+}
+
+fn main() {}