11error[E0631]: type mismatch in function arguments
2- --> $DIR/suggest-option-asderef-unfixable.rs:28 :40
2+ --> $DIR/suggest-option-asderef-unfixable.rs:24 :40
33 |
44LL | fn takes_str_but_too_many_refs(_: &&str) -> Option<()> {
55 | ------------------------------------------------------ found signature defined here
@@ -15,7 +15,7 @@ note: required by a bound in `Option::<T>::and_then`
1515 --> $SRC_DIR/core/src/option.rs:LL:COL
1616
1717error[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
1919 |
2020LL | let _ = produces_string().and_then(takes_str_but_wrong_abi);
2121 | -------- ^^^^^^^^^^^^^^^^^^^^^^^ 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`
2727 --> $SRC_DIR/core/src/option.rs:LL:COL
2828
2929error[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
3131 |
3232LL | let _ = produces_string().and_then(takes_str_but_unsafe);
3333 | -------- ^^^^^^^^^^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
@@ -40,7 +40,7 @@ note: required by a bound in `Option::<T>::and_then`
4040 --> $SRC_DIR/core/src/option.rs:LL:COL
4141
4242error[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
4444 |
4545LL | fn no_args() -> Option<()> {
4646 | -------------------------- takes 0 arguments
@@ -54,28 +54,7 @@ note: required by a bound in `Option::<T>::and_then`
5454 --> $SRC_DIR/core/src/option.rs:LL:COL
5555
5656error[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
7958 |
8059LL | fn takes_str_but_too_many_refs(_: &&str) -> Option<()> {
8160 | ------------------------------------------------------ found signature defined here
@@ -90,7 +69,7 @@ LL | let _ = Some(TypeWithoutDeref).and_then(takes_str_but_too_many_refs);
9069note: required by a bound in `Option::<T>::and_then`
9170 --> $SRC_DIR/core/src/option.rs:LL:COL
9271
93- error: aborting due to 6 previous errors
72+ error: aborting due to 5 previous errors
9473
9574Some errors have detailed explanations: E0277, E0593, E0631.
9675For more information about an error, try `rustc --explain E0277`.
0 commit comments