Skip to content

Conversation

@Kivooeo
Copy link
Member

@Kivooeo Kivooeo commented Dec 15, 2025

not for merge, at least for now

part of #149932

not sure how correct this approach is, also it maybe will fail on a cargo tests because I had some difficult time on a blessing them

so this PR is just to show to Scott @Muscraft on what I've done already and if I'm on a right track

the main problem I faced is that there is no difference on an tests output? and I don't know if there should be any difference, so yeah, maybe I missed something or maybe it should be like this

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 15, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the annotate-snippets-stable branch from e4ad760 to 0298975 Compare December 15, 2025 20:34
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the annotate-snippets-stable branch from 0298975 to 9932c0b Compare December 15, 2025 21:51
@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Dec 15, 2025
Copy link
Member

@Muscraft Muscraft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main problem I faced is that there is no difference on an tests output? and I don't know if there should be any difference, so yeah, maybe I missed something or maybe it should be like this

There really shouldn't be any test difference as annotate-snippets is already used on nightly, which means that all tests are currently ran against it.

View changes since this review

Comment on lines -529 to -534
// FIXME: This hack should be removed once annotate_snippets is the
// default emitter.
if suggestions_expected > 0 && report.is_empty() {
group = group.element(Padding);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this change (and anything related) to its own commit after the change to make annotate-snippets the default. This will make it so that the switch to annotate-snippets shows now visible test changes (I think).

let format = match format {
ErrorOutputType::Json { pretty: true, .. } => "pretty-json",
ErrorOutputType::HumanReadable { kind, .. } => match kind {
HumanReadableErrorType::AnnotateSnippet { unicode: false, .. } => "human-annotate-rs",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make the removal of the human-annotate-rs flag its own commit, although I am not sure if it should be before or after the commit switching to annotate-snippets as the default.

Note: That change will also require removing any references to it

ErrorOutputType::Json { pretty: true, .. } => "pretty-json",
ErrorOutputType::HumanReadable { kind, .. } => match kind {
HumanReadableErrorType::AnnotateSnippet { unicode: false, .. } => "human-annotate-rs",
HumanReadableErrorType::AnnotateSnippet { unicode: true, .. } => "human-unicode",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't remove support for human-unicode as is being tracked separately from using annotate-snippets as the default emitter.

#[default]
HumanReadable {
kind: HumanReadableErrorType = HumanReadableErrorType::Default { short: false },
kind: HumanReadableErrorType = HumanReadableErrorType::AnnotateSnippet { short: false, unicode: false },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would make sense to remove HumanReadableErrorType::Default as a variant of HumanReadableErrorType. This would make it easier to verify that everything is truly using HumanReadableErrorType::AnnotateSnippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants