about summary refs log tree commit diff
path: root/tests/ui/impl-trait/method-resolution5-deref-no-constrain.current.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/method-resolution5-deref-no-constrain.current.stderr')
-rw-r--r--tests/ui/impl-trait/method-resolution5-deref-no-constrain.current.stderr19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/method-resolution5-deref-no-constrain.current.stderr b/tests/ui/impl-trait/method-resolution5-deref-no-constrain.current.stderr
new file mode 100644
index 00000000000..08578de426a
--- /dev/null
+++ b/tests/ui/impl-trait/method-resolution5-deref-no-constrain.current.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/method-resolution5-deref-no-constrain.rs:20:5
+   |
+LL | fn via_deref() -> impl Deref<Target = Foo> {
+   |                                       --- expected `&Foo` because of return type
+...
+LL |     Box::new(Foo)
+   |     ^^^^^^^^^^^^^ expected `&Foo`, found `Box<Foo>`
+   |
+   = note: expected reference `&Foo`
+                 found struct `Box<Foo>`
+help: consider borrowing here
+   |
+LL |     &Box::new(Foo)
+   |     +
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.