about summary refs log tree commit diff
path: root/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr')
-rw-r--r--tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr b/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr
index 688f8af0822..d227c8778fe 100644
--- a/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr
+++ b/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr
@@ -4,6 +4,20 @@ error[E0228]: the lifetime bound for this object type cannot be deduced from con
 LL | fn bar(x: &str) -> &dyn Foo<Item = dyn Bar> { &() }
    |                                    ^^^^^^^
 
-error: aborting due to 1 previous error
+error[E0277]: the trait bound `(): Foo<'_>` is not satisfied
+  --> $DIR/object-lifetime-default-dyn-binding-nonstatic3.rs:16:47
+   |
+LL | fn bar(x: &str) -> &dyn Foo<Item = dyn Bar> { &() }
+   |                                               ^^^ the trait `Foo<'_>` is not implemented for `()`
+   |
+help: this trait has no implementations, consider adding one
+  --> $DIR/object-lifetime-default-dyn-binding-nonstatic3.rs:4:1
+   |
+LL | trait Foo<'a> {
+   | ^^^^^^^^^^^^^
+   = note: required for the cast from `&()` to `&dyn Foo<'_, Item = dyn Bar>`
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0228`.
+Some errors have detailed explanations: E0228, E0277.
+For more information about an error, try `rustc --explain E0228`.