]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #66594 - Aaron1011:fix/debug-print-cycle, r=matthewjasper
authorMazdak Farrokhzad <twingoow@gmail.com>
Sun, 24 Nov 2019 02:17:01 +0000 (03:17 +0100)
committerGitHub <noreply@github.com>
Sun, 24 Nov 2019 02:17:01 +0000 (03:17 +0100)
commita3ff52ce92f1dedea32c69afbbd3dabb6b457731
treedd536bf4935d33d2652eac963df80f49e6b40cd4
parent9b0427fc943490fd0065c656afd185a219b672c4
parent2ba982d0e5ad87581e3685cba9207ffaf61a866e
Rollup merge of #66594 - Aaron1011:fix/debug-print-cycle, r=matthewjasper

Fix cycle when debug-printing opaque types

Fixes #61577

When printing an opaque type in non-verbose mode, we use the
`tcx.predicates_of` query to retrieve the opaque type's bounds for
pretty-printing. However, the pervasiveness of logging within librustc
means that we may already be executing `tcx.predicates_of` for the
opaque type we're trying to print, leading to a cycle error.

This commit adds a new 'no queries' thread-local flag to the pretty
printer. This flag is enabled during the computation of `predicates_of`
for opaque types, and causes us to print the opaque type in 'verbose'
mode (which does not require computing any additinal queries). This
should only affect debug logging for highly nested log messages, not any
user-visible output.