question mark return type alias
The two test cases type_alias_question_mark and type_alias_question_mark_return fail because of the type alias.
@@ -16,6 +16,10 @@ fn other() -> Result<SimpleOutput, u8> {
Result::<SimpleOutput, u8>::Err(1u8)
}
+fn other_result_alias() -> SimpleOutputResult {
+ Result::<SimpleOutput, u8>::Err(1u8)
+}
+
pub fn type_confusion() -> Result<SimpleOutput, u8> {
other()
}
@@ -23,3 +27,13 @@ pub fn type_confusion() -> Result<SimpleOutput, u8> {
pub fn return_type_alias() -> Result<SimpleOutput, u8> {
SimpleOutputResult::Err(1u8)
}
+
+pub fn type_alias_question_mark() -> Result<SimpleOutput, u8> {
+ let other_result = other_result_alias()?;
+ SimpleOutputResult::Err(1u8)
+}
+
+pub fn type_alias_question_mark_return() -> SimpleOutputResult {
+ let other_result = other()?;
+ SimpleOutputResult::Err(1u8)
+}
