summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-06 10:54:58 -0800
committerbors <bors@rust-lang.org>2013-03-06 10:54:58 -0800
commit876b6ba792f83f1b50d1356e7305f334b5ba2f05 (patch)
treecbf0a07e3ac91f1fc127eb86bee5be228fb276fc /src/libsyntax
parent4b79a58d9d30c09366e562691d50182b335aef6e (diff)
parent704cd648ac1160c5f02291e505697a6cf7e20945 (diff)
downloadrust-876b6ba792f83f1b50d1356e7305f334b5ba2f05.tar.gz
rust-876b6ba792f83f1b50d1356e7305f334b5ba2f05.zip
auto merge of #5253 : nikomatsakis/rust/issue-5243, r=graydon
them to be non-monomorphic.  Merely having lifetime parameters
is not enough to qualify for that status.  Fixes #5243.

r?
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs10
-rw-r--r--src/libsyntax/print/pprust.rs2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 484fff1f9de..1ec11501f33 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -161,8 +161,14 @@ pub struct Generics {
 }
 
 pub impl Generics {
-    fn is_empty(&self) -> bool {
-        self.lifetimes.len() + self.ty_params.len() == 0
+    fn is_parameterized(&self) -> bool {
+        self.lifetimes.len() + self.ty_params.len() > 0
+    }
+    fn is_lt_parameterized(&self) -> bool {
+        self.lifetimes.len() > 0
+    }
+    fn is_type_parameterized(&self) -> bool {
+        self.ty_params.len() > 0
     }
 }
 
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index d307e3964e7..275f5a43397 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -567,7 +567,7 @@ pub fn print_item(s: @ps, &&item: @ast::item) {
 
       ast::item_impl(ref generics, opt_trait, ty, ref methods) => {
         head(s, visibility_qualified(item.vis, ~"impl"));
-        if !generics.is_empty() {
+        if generics.is_parameterized() {
             print_generics(s, generics);
             space(s.s);
         }