We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ty::ClosureKind::extends
1 parent d6f73c1 commit e9f6db5Copy full SHA for e9f6db5
compiler/rustc_middle/src/ty/closure.rs
@@ -96,15 +96,7 @@ impl<'tcx> ClosureKind {
96
/// Returns `true` if a type that impls this closure kind
97
/// must also implement `other`.
98
pub fn extends(self, other: ty::ClosureKind) -> bool {
99
- matches!(
100
- (self, other),
101
- (ClosureKind::Fn, ClosureKind::Fn)
102
- | (ClosureKind::Fn, ClosureKind::FnMut)
103
- | (ClosureKind::Fn, ClosureKind::FnOnce)
104
- | (ClosureKind::FnMut, ClosureKind::FnMut)
105
- | (ClosureKind::FnMut, ClosureKind::FnOnce)
106
- | (ClosureKind::FnOnce, ClosureKind::FnOnce)
107
- )
+ self <= other
108
}
109
110
/// Returns the representative scalar type for this closure kind.
0 commit comments