Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f67c50

Browse files
committed
RemoveDelayDm
With the removal of `LintDiagnostic::msg` / the `msg` param fromlint diag APIs, primary messages for lint diags are always constructedlazily inside decorator fns rendering this wrapper type unused / useless.
1 parent06bc4fc commit9f67c50

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

‎compiler/rustc_error_messages/src/lib.rs‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,6 @@ impl From<Cow<'static, str>> for DiagMessage {
367367
}
368368
}
369369

370-
/// A workaround for must_produce_diag ICEs when formatting types in disabled lints.
371-
///
372-
/// Delays formatting until `.into(): DiagMessage` is used.
373-
pubstructDelayDm<F>(pubF);
374-
375-
impl<F:FnOnce() ->String>From<DelayDm<F>>forDiagMessage{
376-
fnfrom(DelayDm(f):DelayDm<F>) ->Self{
377-
DiagMessage::from(f())
378-
}
379-
}
380-
381370
/// Translating *into* a subdiagnostic message from a diagnostic message is a little strange - but
382371
/// the subdiagnostic functions (e.g. `span_label`) take a `SubdiagMessage` and the
383372
/// subdiagnostic derive refers to typed identifiers that are `DiagMessage`s, so need to be

‎compiler/rustc_errors/src/lib.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub use diagnostic_impls::{
3939
};
4040
pubuse emitter::ColorConfig;
4141
pubuse rustc_error_messages::{
42-
fallback_fluent_bundle, fluent_bundle,DelayDm,DiagMessage,FluentBundle,LanguageIdentifier,
42+
fallback_fluent_bundle, fluent_bundle,DiagMessage,FluentBundle,LanguageIdentifier,
4343
LazyFallbackBundle,MultiSpan,SpanLabel,SubdiagMessage,
4444
};
4545
pubuse rustc_lint_defs::{pluralize,Applicability};
@@ -572,8 +572,8 @@ impl Drop for DiagCtxtInner {
572572
ifletSome(backtrace) =&self.must_produce_diag{
573573
panic!(
574574
"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}"
577577
);
578578
}
579579
}

‎compiler/rustc_middle/src/ty/print/pretty.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3327,7 +3327,7 @@ fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, N
33273327
///
33283328
/// The implementation uses similar import discovery logic to that of 'use' suggestions.
33293329
///
3330-
/// See also [`DelayDm`](rustc_error_messages::DelayDm) and [`with_no_trimmed_paths!`].
3330+
/// See also [`with_no_trimmed_paths!`].
33313331
// this is pub to be able to intra-doc-link it
33323332
pubfntrimmed_def_paths(tcx:TyCtxt<'_>,():()) ->DefIdMap<Symbol>{
33333333
// Trimming paths is expensive and not optimized, since we expect it to only be used for error

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp