about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-22 22:12:09 +0100
committerGitHub <noreply@github.com>2024-01-22 22:12:09 +0100
commit31b56a8a3532de8bc80f961c237b603f654fd5d6 (patch)
tree1751f6796d5e8689bee3e7bc0f8d08129d2b92d2
parent8966d606500c5cbc318329df258f2030efd84daf (diff)
parent012a304a167aa4bafe91f40cc73ed4bb0073877c (diff)
downloadrust-31b56a8a3532de8bc80f961c237b603f654fd5d6.tar.gz
rust-31b56a8a3532de8bc80f961c237b603f654fd5d6.zip
Rollup merge of #120216 - nnethercote:fix-trimmed_def_paths-assertion, r=compiler-errors
Fix a `trimmed_def_paths` assertion failure.

`RegionHighlightMode::force_print_trimmed_def_path` can call `trimmed_def_paths` even when `tcx.sess.opts.trimmed_def_paths` is false. Based on the `force` in the method name, it seems this is deliberate, so I have removed the assertion.

Fixes #120035.

r? `@compiler-errors`
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index 4028de27cae..a06f4c6ba12 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -3072,8 +3072,6 @@ fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, N
 /// See also [`DelayDm`](rustc_error_messages::DelayDm) and [`with_no_trimmed_paths!`].
 // this is pub to be able to intra-doc-link it
 pub fn trimmed_def_paths(tcx: TyCtxt<'_>, (): ()) -> DefIdMap<Symbol> {
-    assert!(tcx.sess.opts.trimmed_def_paths);
-
     // Trimming paths is expensive and not optimized, since we expect it to only be used for error
     // reporting.
     //