Move Def out of syntax crate, where it does not belong
Stop passing around Option<&substs> in trans and just pass &substs, making the code more regular
Add missing test case for contravariant trait matching
Fix resolve to not permit refs to type vars from outer fns
(Fixes #14603)