This is a common pattern in sema, so factor it out. Since this version uses `intern` instead of `intern_mut`, it might be a tiny bit faster when errors occur due to not writing names into maps then. When no error occurs, ISLE should do exactly the same work with or without this commit.
ISLE: Instruction Selection / Lowering Expressions
ISLE is a domain specific language (DSL) for instruction selection and lowering
clif instructions to vcode's MachInsts in Cranelift.
ISLE is a statically-typed term-rewriting language. You define rewriting rules
that map input terms (clif instructions) into output terms (MachInsts). These
rules get compiled down into Rust source test that uses a tree of match
expressions that is as good or better than what you would have written by hand.