factor out some common code and make the on-elimination truncation test debug-only
factor out some common code and make the on-elimination truncation test debug-only

aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust