about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-01-31 11:52:46 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-01-31 11:52:46 -0800
commit45c1dfe5b318dac6641dee439d6498209cae455a (patch)
treef746e04a589c6596937aad2aa4a9986667660c25 /src/comp
parentfba35e1a3c87892823d1f4d436b9f00a7864cf16 (diff)
downloadrust-45c1dfe5b318dac6641dee439d6498209cae455a.tar.gz
rust-45c1dfe5b318dac6641dee439d6498209cae455a.zip
Don't compute pre- and postconditions for item_consts
Since item_consts can't refer to or modify local variables, they
don't participate in typestate and thus get empty pre and
postconditions by default.

Closes #1660
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/tstate/pre_post_conditions.rs17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/comp/middle/tstate/pre_post_conditions.rs b/src/comp/middle/tstate/pre_post_conditions.rs
index 9977b20cddb..dcb117cb6a3 100644
--- a/src/comp/middle/tstate/pre_post_conditions.rs
+++ b/src/comp/middle/tstate/pre_post_conditions.rs
@@ -41,22 +41,7 @@ fn find_pre_post_method(ccx: crate_ctxt, m: @method) {
 fn find_pre_post_item(ccx: crate_ctxt, i: item) {
     alt i.node {
       item_const(_, e) {
-        // make a fake fcx
-        let v: @mutable [node_id] = @mutable [];
-        let fake_fcx =
-            {
-             // just bogus
-             enclosing:
-                 {constrs: new_def_hash::<constraint>(),
-                  num_constraints: 0u,
-                  cf: return_val,
-                  i_return: ninit(0, ""),
-                  i_diverge: ninit(0, ""),
-                  used_vars: v},
-             id: 0,
-             name: "",
-             ccx: ccx};
-        find_pre_post_expr(fake_fcx, e);
+          // do nothing -- item_consts don't refer to local vars
       }
       item_fn(_, _, body) {
         assert (ccx.fm.contains_key(i.id));