Allow paths in constants to refer to polymorphic items.

See the added run-pass test for all the newly supported cases.
This is a prerequisite for rvalue promotion. Fixes #13970.
r? @nikomatsakis