Skip to content

Commit 32dc78e

Browse files
committed
Avoid Diagnostic::new_with_code(..., None, ...).
`Diagnostic::new` can be used instead.
1 parent ed95f39 commit 32dc78e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl<'a> DiagnosticBuilder<'a, ()> {
188188
level: Level,
189189
message: M,
190190
) -> Self {
191-
let diagnostic = Diagnostic::new_with_code(level, None, message);
191+
let diagnostic = Diagnostic::new(level, message);
192192
Self::new_diagnostic(handler, diagnostic)
193193
}
194194

@@ -257,7 +257,7 @@ impl EmissionGuarantee for Noted {
257257
DiagnosticBuilder {
258258
inner: DiagnosticBuilderInner {
259259
state: DiagnosticBuilderState::Emittable(handler),
260-
diagnostic: Box::new(Diagnostic::new_with_code(Level::Note, None, msg)),
260+
diagnostic: Box::new(Diagnostic::new(Level::Note, msg)),
261261
},
262262
_marker: PhantomData,
263263
}
@@ -292,7 +292,7 @@ impl EmissionGuarantee for Bug {
292292
DiagnosticBuilder {
293293
inner: DiagnosticBuilderInner {
294294
state: DiagnosticBuilderState::Emittable(handler),
295-
diagnostic: Box::new(Diagnostic::new_with_code(Level::Bug, None, msg)),
295+
diagnostic: Box::new(Diagnostic::new(Level::Bug, msg)),
296296
},
297297
_marker: PhantomData,
298298
}
@@ -322,7 +322,7 @@ impl EmissionGuarantee for ! {
322322
DiagnosticBuilder {
323323
inner: DiagnosticBuilderInner {
324324
state: DiagnosticBuilderState::Emittable(handler),
325-
diagnostic: Box::new(Diagnostic::new_with_code(Level::Fatal, None, msg)),
325+
diagnostic: Box::new(Diagnostic::new(Level::Fatal, msg)),
326326
},
327327
_marker: PhantomData,
328328
}
@@ -352,7 +352,7 @@ impl EmissionGuarantee for rustc_span::fatal_error::FatalError {
352352
DiagnosticBuilder {
353353
inner: DiagnosticBuilderInner {
354354
state: DiagnosticBuilderState::Emittable(handler),
355-
diagnostic: Box::new(Diagnostic::new_with_code(Level::Fatal, None, msg)),
355+
diagnostic: Box::new(Diagnostic::new(Level::Fatal, msg)),
356356
},
357357
_marker: PhantomData,
358358
}

0 commit comments

Comments
 (0)