about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/traits/trait-upcasting/add-supertrait-auto-traits.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/traits/trait-upcasting/add-supertrait-auto-traits.rs b/tests/ui/traits/trait-upcasting/add-supertrait-auto-traits.rs
new file mode 100644
index 00000000000..7e242ed9126
--- /dev/null
+++ b/tests/ui/traits/trait-upcasting/add-supertrait-auto-traits.rs
@@ -0,0 +1,14 @@
+// check-pass
+// revisions: current next
+//[next] compile-flags: -Znext-solver
+
+#![feature(trait_upcasting)]
+
+trait Target {}
+trait Source: Send + Target {}
+
+fn upcast(x: &dyn Source) -> &(dyn Target + Send) { x }
+
+fn same(x: &dyn Source) -> &(dyn Source + Send) { x }
+
+fn main() {}