Remove dead code.

This code is safe to remove as it can never run.

Closes #3839