You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checked_captures.push(match capture {
ByValue(name, span) => CheckedCapture::ByValue(name, span)
ByReference(name, span) => CheckedCapture::ByReference(name, span)
ByMutableReference(name, span) => CheckedCapture::ByMutableReference(name, span)
AllByReference(span) => {
.compiler.panic("AllByReference capture should not be looked up by name")
}
})
This is not, and gives us Type mismatch: expected ‘CheckedCapture’, but got ‘never’:
checked_captures.push(match capture {
ByValue(name, span) => CheckedCapture::ByValue(name, span)
ByReference(name, span) => CheckedCapture::ByReference(name, span)
ByMutableReference(name, span) => CheckedCapture::ByMutableReference(name, span)
AllByReference(span) => .compiler.panic("AllByReference capture should not be looked up by name")
})
This turns out to be intended behaviour: the short => foo syntax can only be used for yielding values. However, a nicer error message when a match has a type mismatch with never, would be very helpful! It should tell you that you need to wrap it in {}.
The text was updated successfully, but these errors were encountered:
This is fine:
This is not, and gives us
Type mismatch: expected ‘CheckedCapture’, but got ‘never’
:This turns out to be intended behaviour: the short
=> foo
syntax can only be used for yielding values. However, a nicer error message when a match has a type mismatch withnever
, would be very helpful! It should tell you that you need to wrap it in{}
.The text was updated successfully, but these errors were encountered: