Skip to content

Commit d8758cd

Browse files
committed
add doc comment detail
1 parent ce259e2 commit d8758cd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: compiler/rustc_errors/src/diagnostic.rs

+5
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ where
147147
/// Implemented as a custom trait rather than `From` so that it is implemented on the type being
148148
/// converted rather than on `DiagArgValue`, which enables types from other `rustc_*` crates to
149149
/// implement this.
150+
///
151+
/// It takes a `path` where "long values" could have been written to, if the `DiagArgValue` would be
152+
/// too big for displaying on the terminal. This path comes from the `Diag` itself. When rendering
153+
/// values that come from `TyCtxt`, like `Ty<'_>`, they can use `TyCtxt::short_string`. If a value
154+
/// has no shortening logic that could be used, the argument can be safely ignored.
150155
pub trait IntoDiagArg {
151156
fn into_diag_arg(self, path: &mut Option<std::path::PathBuf>) -> DiagArgValue;
152157
}

0 commit comments

Comments
 (0)