about summary refs log tree commit diff
path: root/tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.current.stderr
blob: 08578de426ade0e1e02dbee8a92747b8a9c6c405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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`.