rustc: don't support missing TLS TyCtxt in ty::print.

This commit is contained in:
Eduard-Mihai Burtescu 2018-12-04 20:04:21 +02:00
parent 852fc6d2b6
commit c684814102

View File

@ -33,10 +33,9 @@ pub struct PrintContext {
impl PrintContext {
pub(crate) fn new() -> Self {
ty::tls::with_opt(|tcx| {
let (is_verbose, identify_regions) = tcx.map(
|tcx| (tcx.sess.verbose(), tcx.sess.opts.debugging_opts.identify_regions)
).unwrap_or((false, false));
ty::tls::with(|tcx| {
let (is_verbose, identify_regions) =
(tcx.sess.verbose(), tcx.sess.opts.debugging_opts.identify_regions);
PrintContext {
is_debug: false,
is_verbose: is_verbose,