librustc: Only emit visitor glue if it's necessary.

r? @graydon