summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/return-dyn-type-mismatch-2.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/typeck/return-dyn-type-mismatch-2.stderr')
-rw-r--r--tests/ui/typeck/return-dyn-type-mismatch-2.stderr15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/typeck/return-dyn-type-mismatch-2.stderr b/tests/ui/typeck/return-dyn-type-mismatch-2.stderr
new file mode 100644
index 000000000..9c368e838
--- /dev/null
+++ b/tests/ui/typeck/return-dyn-type-mismatch-2.stderr
@@ -0,0 +1,15 @@
+error[E0308]: mismatched types
+ --> $DIR/return-dyn-type-mismatch-2.rs:7:5
+ |
+LL | fn foo<T>() -> dyn Trait<T>
+ | ------------ expected `(dyn Trait<T> + 'static)` because of return type
+...
+LL | 42
+ | ^^ expected `dyn Trait`, found integer
+ |
+ = note: expected trait object `(dyn Trait<T> + 'static)`
+ found type `{integer}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.