error[E0308]: mismatched types
--> src/trybuild_tests/custom_merge_wrong_signature.rs
|
| #[derive(Config)]
| ^^^^^^ expected fn pointer, found fn item
|
= note: expected fn pointer `fn(std::option::Option<std::string::String>, std::option::Option<std::string::String>) -> Result<std::option::Option<std::string::String>, _>`
found fn item `fn(std::string::String, std::string::String) -> Result<std::string::String, Box<(dyn StdError + 'static)>> {merge_hosts}`
= note: this error originates in the derive macro `Config` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: arguments to this function are incorrect
--> src/trybuild_tests/custom_merge_wrong_signature.rs
|
| #[derive(Config)]
| ^^^^^^
| |
| expected `String`, found `Option<String>`
| expected `String`, found `Option<String>`
|
= note: expected struct `std::string::String`
found enum `std::option::Option<std::string::String>`
= note: expected struct `std::string::String`
found enum `std::option::Option<std::string::String>`
note: function defined here
--> src/trybuild_tests/custom_merge_wrong_signature.rs
|
| pub fn merge_hosts(_: String, b: String) -> Result<String, Box<dyn core::error::Error>> {
| ^^^^^^^^^^^ --------- ---------
= note: this error originates in the derive macro `Config` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider using `Option::expect` to unwrap the `std::option::Option<std::string::String>` value, panicking if the value is an `Option::None`
|
7 | #[derive(Config.expect("REASON"))]
| +++++++++++++++++
help: consider using `Option::expect` to unwrap the `std::option::Option<std::string::String>` value, panicking if the value is an `Option::None`
|
7 | #[derive(Config.expect("REASON"))]
| +++++++++++++++++
error[E0308]: mismatched types
--> src/trybuild_tests/custom_merge_wrong_signature.rs
|
| #[derive(Config)]
| ^^^^^^ expected `Option<String>`, found `Result<String, ConfigError>`
|
= note: expected enum `std::option::Option<std::string::String>`
found enum `Result<std::string::String, ConfigError>`
= note: this error originates in the derive macro `Config` (in Nightly builds, run with -Z macro-backtrace for more info)