]> git.lizzy.rs Git - rust.git/commit
Auto merge of #49045 - Zoxc:tls, r=michaelwoerister
authorbors <bors@rust-lang.org>
Thu, 5 Apr 2018 16:38:15 +0000 (16:38 +0000)
committerbors <bors@rust-lang.org>
Thu, 5 Apr 2018 16:38:15 +0000 (16:38 +0000)
commit7222241e7c2d7caf9ad6ee6e34748e4addfb8dd3
tree307f491346376bb59d85e371c6c2a4fff1464b18
parent56714acc5eb0687ed9a7566fdebe5528657fc5b3
parent4f7d0fde1c5f577c1f956d5d4edfbb202a5bc3cf
Auto merge of #49045 - Zoxc:tls, r=michaelwoerister

Make queries thread safe

This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack.

This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606).

cc @rust-lang/compiler

r? @michaelwoerister
src/librustc/ty/context.rs
src/librustc/ty/maps/mod.rs
src/librustc/ty/maps/plumbing.rs
src/librustc_errors/lib.rs