Check lifetime parameters when resolving impls; use `ty::substs` in trans

Code to use `ty::substs` in trans. As part of this, uncovered (and fixed) issue #14050.

r? @pcwalton