summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/bound/sugar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/traits/bound/sugar.rs')
-rw-r--r--src/test/ui/traits/bound/sugar.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/traits/bound/sugar.rs b/src/test/ui/traits/bound/sugar.rs
new file mode 100644
index 000000000..65b6f6faa
--- /dev/null
+++ b/src/test/ui/traits/bound/sugar.rs
@@ -0,0 +1,19 @@
+// Tests for "default" bounds inferred for traits with no bounds list.
+
+trait Foo {}
+
+fn a(_x: Box<dyn Foo + Send>) {
+}
+
+fn b(_x: &'static (dyn Foo + 'static)) {
+}
+
+fn c(x: Box<dyn Foo + Sync>) {
+ a(x); //~ ERROR mismatched types
+}
+
+fn d(x: &'static (dyn Foo + Sync)) {
+ b(x);
+}
+
+fn main() {}