Skip to main content

Module json

Module json 

Source
Expand description

A JSON emitter for errors.

This works by converting errors to a simplified structural format (see the structs at the start of the file) and then serializing them. These should contain as much information about the error as possible.

The format of the JSON output should be considered unstable. For now the structs at the end of this file (Diagnostic*) specify the error format.

Re-exportsยง

use std::io; ๐Ÿ”’
use std::io::Write; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use std::sync::Mutex; ๐Ÿ”’
use std::vec; ๐Ÿ”’
use std::vec; ๐Ÿ”’
use anstream::AutoStream; ๐Ÿ”’
use anstream::ColorChoice; ๐Ÿ”’
use derive_setters::Setters; ๐Ÿ”’
use rustc_data_structures::sync::IntoDynSyncSend; ๐Ÿ”’
use rustc_error_messages::DiagArgMap; ๐Ÿ”’
use rustc_lint_defs::Applicability; ๐Ÿ”’
use rustc_span::hygiene::ExpnData; ๐Ÿ”’
use rustc_span::source_map::FilePathMapping; ๐Ÿ”’
use rustc_span::source_map::SourceMap; ๐Ÿ”’
use rustc_span::FileName; ๐Ÿ”’
use rustc_span::RealFileName; ๐Ÿ”’
use rustc_span::Span; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use crate::annotate_snippet_emitter_writer::AnnotateSnippetEmitter; ๐Ÿ”’
use crate::diagnostic::IsLint; ๐Ÿ”’
use crate::emitter::ColorConfig; ๐Ÿ”’
use crate::emitter::Destination; ๐Ÿ”’
use crate::emitter::Emitter; ๐Ÿ”’
use crate::emitter::HumanReadableErrorType; ๐Ÿ”’
use crate::emitter::OutputTheme; ๐Ÿ”’
use crate::emitter::TimingEvent; ๐Ÿ”’
use crate::emitter::should_show_source_code; ๐Ÿ”’
use crate::formatting::format_diag_message; ๐Ÿ”’
use crate::formatting::format_diag_messages; ๐Ÿ”’
use crate::timings::TimingRecord; ๐Ÿ”’
use crate::timings::TimingSection; ๐Ÿ”’
use crate::CodeSuggestion; ๐Ÿ”’
use crate::MultiSpan; ๐Ÿ”’
use crate::SpanLabel; ๐Ÿ”’
use crate::Subdiag; ๐Ÿ”’
use crate::Suggestions; ๐Ÿ”’
use crate::TerminalUrl; ๐Ÿ”’

Structsยง

ArtifactNotification ๐Ÿ”’
Diagnostic ๐Ÿ”’
DiagnosticCode ๐Ÿ”’
DiagnosticSpan ๐Ÿ”’
DiagnosticSpanLine ๐Ÿ”’
DiagnosticSpanMacroExpansion ๐Ÿ”’
FutureBreakageItem ๐Ÿ”’
FutureIncompatReport ๐Ÿ”’
JsonEmitter
SectionTimestamp ๐Ÿ”’
UnusedExterns ๐Ÿ”’

Enumsยง

EmitTyped ๐Ÿ”’