about summary refs log tree commit diff
path: root/src/comp/middle/ty.rs
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-06-20 17:29:54 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2011-06-21 14:37:33 -0700
commit7fb35ecf84c3fd5f92c2af287d478eb70cbacdbd (patch)
tree58823f0d3ba4216b2e0ef5c372bf8a5ec965a7f4 /src/comp/middle/ty.rs
parent3b6d94d4894e06feeb9b48f291a76ff02d0c31ff (diff)
downloadrust-7fb35ecf84c3fd5f92c2af287d478eb70cbacdbd.tar.gz
rust-7fb35ecf84c3fd5f92c2af287d478eb70cbacdbd.zip
Serialize constraints in types (literal arguments still not supported)
This involved, in part, changing the ast::def type so that a def_fn
has a "purity" field. This lets the typechecker determine whether
functions defined in other crates are pure.

It also required updating some error messages in tests. As a test
for cross-crate constrained functions, I added a safe_slice function
to std::str (slice(), with one of the asserts replaced with a
function precondition) and some test cases (various versions of
fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for
some of the boolean functions in std::uint.
Diffstat (limited to 'src/comp/middle/ty.rs')
-rw-r--r--src/comp/middle/ty.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 37435824fa3..b38c9237cef 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -2610,7 +2610,7 @@ fn substitute_type_params(&ctxt cx, vec[ty::t] substs, t typ) -> t {
 
 fn def_has_ty_params(&ast::def def) -> bool {
     alt (def) {
-        case (ast::def_fn(_)) { ret true; }
+        case (ast::def_fn(_,_)) { ret true; }
         case (ast::def_obj(_)) { ret true; }
         case (ast::def_obj_field(_)) { ret false; }
         case (ast::def_mod(_)) { ret false; }