Add a memoize! macro and use it throughout rustc
Make memoize!() a function instead
auto merge of #17983 : jakub-/rust/memoize-things, r=pcwalton