Is it possible to parametrize returned type of a function?

Well, it's possible that u8 doesn't implement Into<ContainerEnd> it depends on what ContainerEnd is. For example, if I wanted to call problem::<std::io::Error>(), then I shouldn't be able to because u8 doesn't implement Into<std::io::Error>.

1 Like

Is not body explicit enough about implementing trait Into. Does not compiler look into body on that stage of analysis?

No, Rust does not perform type inference or any other kind of inference for function signatures.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.