As described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606/24), checking for too deep recursion when computing data layouts should not need to rely on mutable state in the `GlobalCtxt`. @Zoxc has implemented one possible solution here: https://github.com/rust-lang/rust/pull/49732/commits/cb5138131603624457a8c1fb0f3ce11ea8b7bc0a Maybe there is an even simpler one that does not require explicitly entering a new tcx. cc @eddyb & @nikomatsakis