about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-12-04 08:49:18 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-12-04 18:57:42 +1100
commit32dc78ede8c3e96475d2fbe818d25bb01faec3ad (patch)
tree4d89b0908d37ed8d7d4cddef03efe2d4fc0401f7 /compiler/rustc_errors/src
parented95f397cf83a3ca52a66818963e3fd20d6705c3 (diff)
downloadrust-32dc78ede8c3e96475d2fbe818d25bb01faec3ad.tar.gz
rust-32dc78ede8c3e96475d2fbe818d25bb01faec3ad.zip
Avoid `Diagnostic::new_with_code(..., None, ...)`.
`Diagnostic::new` can be used instead.
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic_builder.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs
index 1366ef52261..354fe1da2c9 100644
--- a/compiler/rustc_errors/src/diagnostic_builder.rs
+++ b/compiler/rustc_errors/src/diagnostic_builder.rs
@@ -188,7 +188,7 @@ impl<'a> DiagnosticBuilder<'a, ()> {
         level: Level,
         message: M,
     ) -> Self {
-        let diagnostic = Diagnostic::new_with_code(level, None, message);
+        let diagnostic = Diagnostic::new(level, message);
         Self::new_diagnostic(handler, diagnostic)
     }
 
@@ -257,7 +257,7 @@ impl EmissionGuarantee for Noted {
         DiagnosticBuilder {
             inner: DiagnosticBuilderInner {
                 state: DiagnosticBuilderState::Emittable(handler),
-                diagnostic: Box::new(Diagnostic::new_with_code(Level::Note, None, msg)),
+                diagnostic: Box::new(Diagnostic::new(Level::Note, msg)),
             },
             _marker: PhantomData,
         }
@@ -292,7 +292,7 @@ impl EmissionGuarantee for Bug {
         DiagnosticBuilder {
             inner: DiagnosticBuilderInner {
                 state: DiagnosticBuilderState::Emittable(handler),
-                diagnostic: Box::new(Diagnostic::new_with_code(Level::Bug, None, msg)),
+                diagnostic: Box::new(Diagnostic::new(Level::Bug, msg)),
             },
             _marker: PhantomData,
         }
@@ -322,7 +322,7 @@ impl EmissionGuarantee for ! {
         DiagnosticBuilder {
             inner: DiagnosticBuilderInner {
                 state: DiagnosticBuilderState::Emittable(handler),
-                diagnostic: Box::new(Diagnostic::new_with_code(Level::Fatal, None, msg)),
+                diagnostic: Box::new(Diagnostic::new(Level::Fatal, msg)),
             },
             _marker: PhantomData,
         }
@@ -352,7 +352,7 @@ impl EmissionGuarantee for rustc_span::fatal_error::FatalError {
         DiagnosticBuilder {
             inner: DiagnosticBuilderInner {
                 state: DiagnosticBuilderState::Emittable(handler),
-                diagnostic: Box::new(Diagnostic::new_with_code(Level::Fatal, None, msg)),
+                diagnostic: Box::new(Diagnostic::new(Level::Fatal, msg)),
             },
             _marker: PhantomData,
         }