Skip to content

Commit

Permalink
add doc comment detail
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Feb 19, 2025
1 parent ce259e2 commit 2dcd85f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ where
/// converted rather than on `DiagArgValue`, which enables types from other `rustc_*` crates to
/// implement this.
pub trait IntoDiagArg {
/// Convert `Self` into a `DiagArgValue` suitable for rendering in a diagnostic.
///
/// It takes a `path` where "long values" could be written to, if the `DiagArgValue` is too big
/// for displaying on the terminal. This path comes from the `Diag` itself. When rendering
/// values that come from `TyCtxt`, like `Ty<'_>`, they can use `TyCtxt::short_string`. If a
/// value has no shortening logic that could be used, the argument can be safely ignored.
fn into_diag_arg(self, path: &mut Option<std::path::PathBuf>) -> DiagArgValue;
}

Expand Down

0 comments on commit 2dcd85f

Please sign in to comment.