1220: Ensure the coercion sites are applied correctly on unions r=philberty a=philberty
When we construct a union, we were wrongly compiling the constructor
without taking into account the associated union index. This meant we
if you were constructing a union using any other field than the first one
you had a bad coercion type check resulting in a silent failure of generating
an error_mark_node.
This was caught using an assertion to ensure there is no error on coercion site but it is valid
to have errors from coercion sites.
1221: Ensure we don't return error_mark_node for loop expressions r=philberty a=philberty
Loop expressions can return a value even if its a unit-type so we must
ensure we don't return an error_mark_node for the eventual coercion site
for the unit-type case.
The offending test-case was: rust/compile/torture/loop7.rs
This was found while fixing #1220
Co-authored-by: Philip Herron <philip.herron@embecosm.com>