1
1
error[E0631]: type mismatch in function arguments
2
- --> $DIR/suggest-option-asderef-unfixable.rs:28 :40
2
+ --> $DIR/suggest-option-asderef-unfixable.rs:24 :40
3
3
|
4
4
LL | fn takes_str_but_too_many_refs(_: &&str) -> Option<()> {
5
5
| ------------------------------------------------------ found signature defined here
@@ -15,7 +15,7 @@ note: required by a bound in `Option::<T>::and_then`
15
15
--> $SRC_DIR/core/src/option.rs:LL:COL
16
16
17
17
error[E0277]: expected a `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}`
18
- --> $DIR/suggest-option-asderef-unfixable.rs:30 :40
18
+ --> $DIR/suggest-option-asderef-unfixable.rs:26 :40
19
19
|
20
20
LL | let _ = produces_string().and_then(takes_str_but_wrong_abi);
21
21
| -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}`
@@ -27,7 +27,7 @@ note: required by a bound in `Option::<T>::and_then`
27
27
--> $SRC_DIR/core/src/option.rs:LL:COL
28
28
29
29
error[E0277]: expected a `FnOnce<(String,)>` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}`
30
- --> $DIR/suggest-option-asderef-unfixable.rs:32 :40
30
+ --> $DIR/suggest-option-asderef-unfixable.rs:28 :40
31
31
|
32
32
LL | let _ = produces_string().and_then(takes_str_but_unsafe);
33
33
| -------- ^^^^^^^^^^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
@@ -40,7 +40,7 @@ note: required by a bound in `Option::<T>::and_then`
40
40
--> $SRC_DIR/core/src/option.rs:LL:COL
41
41
42
42
error[E0593]: function is expected to take 1 argument, but it takes 0 arguments
43
- --> $DIR/suggest-option-asderef-unfixable.rs:34 :40
43
+ --> $DIR/suggest-option-asderef-unfixable.rs:30 :40
44
44
|
45
45
LL | fn no_args() -> Option<()> {
46
46
| -------------------------- takes 0 arguments
@@ -54,28 +54,7 @@ note: required by a bound in `Option::<T>::and_then`
54
54
--> $SRC_DIR/core/src/option.rs:LL:COL
55
55
56
56
error[E0631]: type mismatch in function arguments
57
- --> $DIR/suggest-option-asderef-unfixable.rs:36:40
58
- |
59
- LL | fn generic_ref<T>(_: &T) -> Option<()> {
60
- | -------------------------------------- found signature defined here
61
- ...
62
- LL | let _ = produces_string().and_then(generic_ref);
63
- | -------- ^^^^^^^^^^^ expected due to this
64
- | |
65
- | required by a bound introduced by this call
66
- |
67
- = note: expected function signature `fn(String) -> _`
68
- found function signature `for<'a> fn(&'a _) -> _`
69
- note: required by a bound in `Option::<T>::and_then`
70
- --> $SRC_DIR/core/src/option.rs:LL:COL
71
- help: do not borrow the argument
72
- |
73
- LL - fn generic_ref<T>(_: &T) -> Option<()> {
74
- LL + fn generic_ref<T>(_: T) -> Option<()> {
75
- |
76
-
77
- error[E0631]: type mismatch in function arguments
78
- --> $DIR/suggest-option-asderef-unfixable.rs:38:45
57
+ --> $DIR/suggest-option-asderef-unfixable.rs:32:45
79
58
|
80
59
LL | fn takes_str_but_too_many_refs(_: &&str) -> Option<()> {
81
60
| ------------------------------------------------------ found signature defined here
@@ -90,7 +69,7 @@ LL | let _ = Some(TypeWithoutDeref).and_then(takes_str_but_too_many_refs);
90
69
note: required by a bound in `Option::<T>::and_then`
91
70
--> $SRC_DIR/core/src/option.rs:LL:COL
92
71
93
- error: aborting due to 6 previous errors
72
+ error: aborting due to 5 previous errors
94
73
95
74
Some errors have detailed explanations: E0277, E0593, E0631.
96
75
For more information about an error, try `rustc --explain E0277`.
0 commit comments