Refactor QPath to take an ast::TraitRef
auto merge of #18868 : nikomatsakis/rust/issue-17388-unbound-path-assoc-type, r=pcwalton

This fixes #17388. 

Note that we don't check type parameters in trait-references and so on, so we accept some nonsense (I opened https://github.com/rust-lang/rust/issues/18865). (It may be easier to just add support for `T::Foo` and deprecate the qpath code until we can implement it more robustly using the trait lookup infrastructure, not sure.)