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 4b6e1d1 commit fa89f53Copy full SHA for fa89f53
compiler/rustc_middle/src/ty/closure.rs
@@ -97,15 +97,7 @@ impl<'tcx> ClosureKind {
97
/// Returns `true` if a type that impls this closure kind
98
/// must also implement `other`.
99
pub fn extends(self, other: ty::ClosureKind) -> bool {
100
- matches!(
101
- (self, other),
102
- (ClosureKind::Fn, ClosureKind::Fn)
103
- | (ClosureKind::Fn, ClosureKind::FnMut)
104
- | (ClosureKind::Fn, ClosureKind::FnOnce)
105
- | (ClosureKind::FnMut, ClosureKind::FnMut)
106
- | (ClosureKind::FnMut, ClosureKind::FnOnce)
107
- | (ClosureKind::FnOnce, ClosureKind::FnOnce)
108
- )
+ self <= other
109
}
110
111
/// Returns the representative scalar type for this closure kind.
0 commit comments