about summary refs log tree commit diff
path: root/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.current.stderr
blob: e213dab5d961810b3f3bf61adaf038da9db8e9f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
error[E0382]: use of moved value: `var`
  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:14:9
   |
LL |         let mut var = item_bound_is_too_weak();
   |             ------- move occurs because `var` has type `impl FnOnce()`, which does not implement the `Copy` trait
LL |         var();
   |         ----- `var` moved due to this call
LL |         var();
   |         ^^^ value used here after move
   |
note: this value implements `FnOnce`, which causes it to be moved when called
  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:13:9
   |
LL |         var();
   |         ^^^

error[E0618]: expected function, found `impl Sized`
  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:24:9
   |
LL | fn opaque_type_no_impl_fn() -> impl Sized {
   | ----------------------------------------- `opaque_type_no_impl_fn` defined here returns `impl Sized`
LL |     if false {
LL |         opaque_type_no_impl_fn()();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^--
   |         |
   |         call expression requires function

error[E0618]: expected function, found `impl Sized`
  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:34:9
   |
LL | fn opaque_type_no_impl_fn_incorrect() -> impl Sized {
   | --------------------------------------------------- `opaque_type_no_impl_fn_incorrect` defined here returns `impl Sized`
LL |     if false {
LL |         opaque_type_no_impl_fn_incorrect()();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
   |         |
   |         call expression requires function

error[E0618]: expected function, found `impl Deref<Target = impl Sized>`
  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:44:9
   |
LL | fn opaque_type_deref_no_impl_fn() -> impl Deref<Target = impl Sized> {
   | -------------------------------------------------------------------- `opaque_type_deref_no_impl_fn` defined here returns `impl Deref<Target = impl Sized>`
LL |     if false {
LL |         opaque_type_deref_no_impl_fn()();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
   |         |
   |         call expression requires function

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0382, E0618.
For more information about an error, try `rustc --explain E0382`.