about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_ast/src/ast.rs')
-rw-r--r--compiler/rustc_ast/src/ast.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index ec6ca70ae0a..997c44cffff 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -414,6 +414,12 @@ pub struct WhereClause {
     pub span: Span,
 }
 
+impl WhereClause {
+    pub fn is_empty(&self) -> bool {
+        !self.has_where_token && self.predicates.is_empty()
+    }
+}
+
 impl Default for WhereClause {
     fn default() -> WhereClause {
         WhereClause { has_where_token: false, predicates: ThinVec::new(), span: DUMMY_SP }