This isn't really a bug, at least. The type impl Foo stands for needs to be inferred somehow, and right now the compiler defaults to () in this situation. With #![feature(never_type)] it would default to !, with the same result (right now).
In the second example, the type is just a type parameter specified by the caller, so no issue occurs.
What type should it choose, then? I don't think this is an easy question to answer in all cases.
Diverging control flow (which is what you get after a panic) can generally be of any type, since the code is unreachable. Rustc falls back to assigning () if there is no known, concrete type to assign (this has been the case since before 1.0, I believe). This doesn't really have much to do with impl Trait, specifically.
That said, it would be nice to get this example working somehow, since unimplemented!() would be quite useful.