Lines Matching defs:message

20 /// Represents a single diagnostic message
35 /// Create a new diagnostic message that points to the `span_range`.
39 fn spanned_range(span_range: SpanRange, level: Level, message: String) -> Self;
41 /// Add another error message to self such that it will be emitted right after
42 /// the main message.
48 /// Attach a "help" note to your main message, the note will have it's own span on nightly.
55 /// The span is ignored on stable, the note effectively inherits its parent's (main message) span
58 /// Attach a note to your main message, the note will have it's own span on nightly.
65 /// The span is ignored on stable, the note effectively inherits its parent's (main message) span
70 fn spanned_range(span_range: SpanRange, level: Level, message: String) -> Self {
74 msg: message,
99 /// Create a new diagnostic message that points to `Span::call_site()`
100 pub fn new(level: Level, message: String) -> Self {
101 Diagnostic::spanned(Span::call_site(), level, message)
104 /// Create a new diagnostic message that points to the `span`
105 pub fn spanned(span: Span, level: Level, message: String) -> Self {
112 message,
116 /// Add another error message to self such that it will be emitted right after
117 /// the main message.
128 /// Attach a "help" note to your main message, the note will have it's own span on nightly.
132 /// The span is ignored on stable, the note effectively inherits its parent's (main message) span
143 /// Attach a "help" note to your main message.
149 /// Attach a note to your main message, the note will have it's own span on nightly.
153 /// The span is ignored on stable, the note effectively inherits its parent's (main message) span
164 /// Attach a note to your main message
170 /// The message of main warning/error (no notes attached)
171 pub fn message(&self) -> &str {
237 let message = if suggestions.is_empty() {
240 let mut message = String::new();
241 ensure_lf(&mut message, msg);
242 message.push('\n');
245 message.push_str(" = ");
246 message.push_str(kind.name());
247 message.push_str(": ");
248 ensure_lf(&mut message, note);
250 message.push('\n');
252 Cow::Owned(message)
255 let mut msg = proc_macro2::Literal::string(&message);