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-20 16:53:42 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-12-23 13:23:28 +1100
commitd7a3b6291ce56b0bb96f5fefe123acd8257b8526 (patch)
treec2b1cd5db4d6e289af3ec8e888a8aede9a07db84 /compiler/rustc_errors/src
parent3a1b8e643aa556bb362c3a1c373092242659845c (diff)
downloadrust-d7a3b6291ce56b0bb96f5fefe123acd8257b8526.tar.gz
rust-d7a3b6291ce56b0bb96f5fefe123acd8257b8526.zip
Remove `Diagnostic::new_with_code`.
Its single use can be replaced with `Diagnostic::new_with_messages`.
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs22
1 files changed, 1 insertions, 21 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index be506806065..15b4704de10 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -216,7 +216,7 @@ impl StringPart {
 impl Diagnostic {
     #[track_caller]
     pub fn new<M: Into<DiagnosticMessage>>(level: Level, message: M) -> Self {
-        Diagnostic::new_with_code(level, None, message)
+        Diagnostic::new_with_messages(level, vec![(message.into(), Style::NoStyle)])
     }
 
     #[track_caller]
@@ -235,26 +235,6 @@ impl Diagnostic {
         }
     }
 
-    #[track_caller]
-    pub(crate) fn new_with_code<M: Into<DiagnosticMessage>>(
-        level: Level,
-        code: Option<DiagnosticId>,
-        message: M,
-    ) -> Self {
-        Diagnostic {
-            level,
-            message: vec![(message.into(), Style::NoStyle)],
-            code,
-            span: MultiSpan::new(),
-            children: vec![],
-            suggestions: Ok(vec![]),
-            args: Default::default(),
-            sort_span: DUMMY_SP,
-            is_lint: false,
-            emitted_at: DiagnosticLocation::caller(),
-        }
-    }
-
     #[inline(always)]
     pub fn level(&self) -> Level {
         self.level