ParseSess cleanups by nnethercote · Pull Request #121969 · rust-lang/rust (original) (raw)

Best reviewed one commit at a time. Each commit log has the relevant details.

There is an argument to be made that Session should be renamed Sess, to match ParseSess and all the values named sess, but I haven't done that here.

A question that you might be wondering: why do we even need the Session/ParseSess split? Could they be merged? The short answer is "not really". To do any parsing, you need a ParseSess, and there are a lot of places that need to do at least a little bit of parsing. A Session contains a ParseSess and quite a few other things; it's a bigger and heavier piece of state, and fewer places need all that.

My gut feeling is that the psess renaming doesn't quite reach the level of needing an MCP.