Remove DelayDm · rust-lang/rust@9f67c50 (original) (raw)

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -367,17 +367,6 @@ impl From<Cow<'static, str>> for DiagMessage {
367 367 }
368 368 }
369 369
370 -/// A workaround for must_produce_diag ICEs when formatting types in disabled lints.
371 -///
372 -/// Delays formatting until `.into(): DiagMessage` is used.
373 -pub struct DelayDm<F>(pub F);
374 -
375 -impl<F: FnOnce() -> String> From<DelayDm<F>> for DiagMessage {
376 -fn from(DelayDm(f): DelayDm<F>) -> Self {
377 -DiagMessage::from(f())
378 -}
379 -}
380 -
381 370 /// Translating *into* a subdiagnostic message from a diagnostic message is a little strange - but
382 371 /// the subdiagnostic functions (e.g. `span_label`) take a `SubdiagMessage` and the
383 372 /// subdiagnostic derive refers to typed identifiers that are `DiagMessage`s, so need to be
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ pub use diagnostic_impls::{
39 39 };
40 40 pub use emitter::ColorConfig;
41 41 pub use rustc_error_messages::{
42 - fallback_fluent_bundle, fluent_bundle, DelayDm, DiagMessage, FluentBundle, LanguageIdentifier,
42 + fallback_fluent_bundle, fluent_bundle, DiagMessage, FluentBundle, LanguageIdentifier,
43 43 LazyFallbackBundle, MultiSpan, SpanLabel, SubdiagMessage,
44 44 };
45 45 pub use rustc_lint_defs::{pluralize, Applicability};
@@ -572,8 +572,8 @@ impl Drop for DiagCtxtInner {
572 572 if let Some(backtrace) = &self.must_produce_diag {
573 573 panic!(
574 574 "must_produce_diag: `trimmed_def_paths` called but no diagnostics emitted; \
575 - use `DelayDm` for lints or `with_no_trimmed_paths` for debugging. \
576 - called at: {backtrace}"
575 + `with_no_trimmed_paths` for debugging. \
576 + called at: {backtrace}"
577 577 );
578 578 }
579 579 }
Original file line number Diff line number Diff line change
@@ -3327,7 +3327,7 @@ fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, N
3327 3327 ///
3328 3328 /// The implementation uses similar import discovery logic to that of 'use' suggestions.
3329 3329 ///
3330 -/// See also [`DelayDm`](rustc_error_messages::DelayDm) and [`with_no_trimmed_paths!`].
3330 +/// See also [`with_no_trimmed_paths!`].
3331 3331 // this is pub to be able to intra-doc-link it
3332 3332 pub fn trimmed_def_paths(tcx: TyCtxt<'_>, (): ()) -> DefIdMap<Symbol> {
3333 3333 // Trimming paths is expensive and not optimized, since we expect it to only be used for error