Skip to content

Commit c9b0635

Browse files
committed
Inline and remove DescriptionCtx::add_to.
It has a single callsite.
1 parent 955ba37 commit c9b0635

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

compiler/rustc_infer/src/errors/note_and_explain.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ impl<'a> DescriptionCtx<'a> {
108108
}
109109
Some(me)
110110
}
111-
112-
fn add_to(self, diag: &mut rustc_errors::Diagnostic) {
113-
diag.set_arg("desc_kind", self.kind);
114-
diag.set_arg("desc_arg", self.arg);
115-
}
116111
}
117112

118113
pub enum PrefixKind {
@@ -196,10 +191,11 @@ impl AddToDiagnostic for RegionExplanation<'_> {
196191
{
197192
diag.set_arg("pref_kind", self.prefix);
198193
diag.set_arg("suff_kind", self.suffix);
199-
let desc_span = self.desc.span;
200-
self.desc.add_to(diag);
194+
diag.set_arg("desc_kind", self.desc.kind);
195+
diag.set_arg("desc_arg", self.desc.arg);
196+
201197
let msg = f(diag, fluent::infer_region_explanation.into());
202-
if let Some(span) = desc_span {
198+
if let Some(span) = self.desc.span {
203199
diag.span_note(span, msg);
204200
} else {
205201
diag.note(msg);

0 commit comments

Comments
 (0)