Skip to content

Commit

Permalink
Fix a trimmed_def_paths assertion failure.
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
nnethercote committed Jan 22, 2024
1 parent ef71f10 commit 012a304
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down

0 comments on commit 012a304

Please sign in to comment.