Construct const fns based on the type, not the definition.

Otherwise we can add a null environment when we shouldn't.

Fixes #5210.
Assert that constants are translated with the correct size.
Add a test case for const fn sizing, just to be safe.
auto merge of #5215 : jld/rust/fn-const-env, r=graydon

Fixes #5210; unblocks #5183.