diff --git a/rustenv.py b/rustenv.py
index ac82bb7..4cdbbc2 100644
--- a/rustenv.py
+++ b/rustenv.py
@@ -47,6 +47,7 @@ deactivate_rustenv() {{
     unset _RUSTENV_BIN_PATH
     unset _RUSTENV_OLD_PS1
     unset _RUSTENV_OLD_PATH
+    unset -f deactivate_rustenv
 }}
 '''
 

diff --git a/tests/integration_test.py b/tests/integration_test.py
index 72088d5..e1b3e5c 100644
--- a/tests/integration_test.py
+++ b/tests/integration_test.py
@@ -22,6 +22,7 @@ report() {{
     echo "[[$1-rustc:$(rustc --version 2>&1)]]"
     echo "[[$1-cargo:$(cargo --version 2>&1)]]"
     echo "[[$1-hello:$(hello 2>&1)]]"
+    echo "[[$1-deactivate_rustenv:$(type deactivate_rustenv | head -1)]]"
 }}
 
 report start

`deactivate_rustenv` doesn't remove `deactivate_rustenv`
```console
(renv) asottile@babibox:/tmp
$ deactivate_rustenv 
asottile@babibox:/tmp
$ which cargo
asottile@babibox:/tmp
$ deactivate_rustenv 
ehco hi
bash: ehco: No such file or directory
echo hi
hi
```
tests/integration_test.py::test_runenv_shell[bash-{}:
tests/integration_test.py::test_rustenv_looks_sane