@@ -239,7 +239,7 @@ impl Diagnostic {
239239 }
240240
241241 #[ track_caller]
242- pub fn new_with_code < M : Into < DiagnosticMessage > > (
242+ pub ( crate ) fn new_with_code < M : Into < DiagnosticMessage > > (
243243 level : Level ,
244244 code : Option < DiagnosticId > ,
245245 message : M ,
@@ -281,7 +281,7 @@ impl Diagnostic {
281281 }
282282 }
283283
284- pub fn update_unstable_expectation_id (
284+ pub ( crate ) fn update_unstable_expectation_id (
285285 & mut self ,
286286 unstable_to_stable : & FxHashMap < LintExpectationId , LintExpectationId > ,
287287 ) {
@@ -307,14 +307,14 @@ impl Diagnostic {
307307 }
308308
309309 /// Indicates whether this diagnostic should show up in cargo's future breakage report.
310- pub fn has_future_breakage ( & self ) -> bool {
310+ pub ( crate ) fn has_future_breakage ( & self ) -> bool {
311311 match self . code {
312312 Some ( DiagnosticId :: Lint { has_future_breakage, .. } ) => has_future_breakage,
313313 _ => false ,
314314 }
315315 }
316316
317- pub fn is_force_warn ( & self ) -> bool {
317+ pub ( crate ) fn is_force_warn ( & self ) -> bool {
318318 match self . code {
319319 Some ( DiagnosticId :: Lint { is_force_warn, .. } ) => is_force_warn,
320320 _ => false ,
@@ -391,29 +391,6 @@ impl Diagnostic {
391391 self . note_expected_found_extra ( expected_label, expected, found_label, found, & "" , & "" )
392392 }
393393
394- pub fn note_unsuccessful_coercion (
395- & mut self ,
396- expected : DiagnosticStyledString ,
397- found : DiagnosticStyledString ,
398- ) -> & mut Self {
399- let mut msg: Vec < _ > =
400- vec ! [ ( Cow :: from( "required when trying to coerce from type `" ) , Style :: NoStyle ) ] ;
401- msg. extend ( expected. 0 . iter ( ) . map ( |x| match * x {
402- StringPart :: Normal ( ref s) => ( Cow :: from ( s. clone ( ) ) , Style :: NoStyle ) ,
403- StringPart :: Highlighted ( ref s) => ( Cow :: from ( s. clone ( ) ) , Style :: Highlight ) ,
404- } ) ) ;
405- msg. push ( ( Cow :: from ( "` to type '" ) , Style :: NoStyle ) ) ;
406- msg. extend ( found. 0 . iter ( ) . map ( |x| match * x {
407- StringPart :: Normal ( ref s) => ( Cow :: from ( s. clone ( ) ) , Style :: NoStyle ) ,
408- StringPart :: Highlighted ( ref s) => ( Cow :: from ( s. clone ( ) ) , Style :: Highlight ) ,
409- } ) ) ;
410- msg. push ( ( Cow :: from ( "`" ) , Style :: NoStyle ) ) ;
411-
412- // For now, just attach these as notes
413- self . highlighted_note ( msg) ;
414- self
415- }
416-
417394 pub fn note_expected_found_extra (
418395 & mut self ,
419396 expected_label : & dyn fmt:: Display ,
@@ -475,7 +452,7 @@ impl Diagnostic {
475452 self
476453 }
477454
478- pub fn highlighted_note < M : Into < SubdiagnosticMessage > > (
455+ fn highlighted_note < M : Into < SubdiagnosticMessage > > (
479456 & mut self ,
480457 msg : Vec < ( M , Style ) > ,
481458 ) -> & mut Self {
@@ -572,14 +549,6 @@ impl Diagnostic {
572549 self
573550 }
574551
575- /// Clear any existing suggestions.
576- pub fn clear_suggestions ( & mut self ) -> & mut Self {
577- if let Ok ( suggestions) = & mut self . suggestions {
578- suggestions. clear ( ) ;
579- }
580- self
581- }
582-
583552 /// Helper for pushing to `self.suggestions`, if available (not disable).
584553 fn push_suggestion ( & mut self , suggestion : CodeSuggestion ) {
585554 if let Ok ( suggestions) = & mut self . suggestions {
@@ -992,7 +961,7 @@ impl Diagnostic {
992961 /// Helper function that takes a `SubdiagnosticMessage` and returns a `DiagnosticMessage` by
993962 /// combining it with the primary message of the diagnostic (if translatable, otherwise it just
994963 /// passes the user's string along).
995- pub ( crate ) fn subdiagnostic_message_to_diagnostic_message (
964+ fn subdiagnostic_message_to_diagnostic_message (
996965 & self ,
997966 attr : impl Into < SubdiagnosticMessage > ,
998967 ) -> DiagnosticMessage {
0 commit comments