Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Migrate rustc_ast_passes diagnostics to SessionDiagnostic and translatable messages (second part) #101657

Closed
wants to merge 23 commits into from

Conversation

finalchild
Copy link
Contributor

@finalchild finalchild commented Sep 10, 2022

Second (and hopefully last) PR migrating rustc_ast_passes to SessionDiagnostics.

@rustbot label +A-translation

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 10, 2022
@rust-highfive
Copy link
Collaborator

r? @lcnr

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2022
@rust-log-analyzer

This comment has been minimized.

@finalchild
Copy link
Contributor Author

I don't understand how the CI job failed.

error[E0599]: no variant or associated item named `Type` found for enum `ParamKindOrd` in the current scope
   --> compiler/rustc_errors/src/diagnostic.rs:173:32
    |
173 |             ast::ParamKindOrd::Type => "type",
    |                                ^^^^ variant or associated item not found in `ParamKindOrd`

error[E0599]: no variant or associated item named `Const` found for enum `ParamKindOrd` in the current scope
   --> compiler/rustc_errors/src/diagnostic.rs:174:32
    |
174 |             ast::ParamKindOrd::Const => "const",
    |                                ^^^^^ variant or associated item not found in `ParamKindOrd`

error[E0599]: no variant or associated item named `Infer` found for enum `ParamKindOrd` in the current scope
   --> compiler/rustc_errors/src/diagnostic.rs:175:32
    |
175 |             ast::ParamKindOrd::Infer => "infer",
    |                                ^^^^^ variant or associated item not found in `ParamKindOrd`

Maybe some kind of incremental build issue? Is there a way to clean the cache of CI?

@RanolP
Copy link
Contributor

RanolP commented Sep 11, 2022

I don't understand how the CI job failed.

error[E0599]: no variant or associated item named `Type` found for enum `ParamKindOrd` in the current scope
   --> compiler/rustc_errors/src/diagnostic.rs:173:32
    |
173 |             ast::ParamKindOrd::Type => "type",
    |                                ^^^^ variant or associated item not found in `ParamKindOrd`

error[E0599]: no variant or associated item named `Const` found for enum `ParamKindOrd` in the current scope
   --> compiler/rustc_errors/src/diagnostic.rs:174:32
    |
174 |             ast::ParamKindOrd::Const => "const",
    |                                ^^^^^ variant or associated item not found in `ParamKindOrd`

error[E0599]: no variant or associated item named `Infer` found for enum `ParamKindOrd` in the current scope
   --> compiler/rustc_errors/src/diagnostic.rs:175:32
    |
175 |             ast::ParamKindOrd::Infer => "infer",
    |                                ^^^^^ variant or associated item not found in `ParamKindOrd`

Maybe some kind of incremental build issue? Is there a way to clean the cache of CI?

I think ae49732 caused the error on your code. The commit has changed the ParamKindOrd, you're trying to impl, from master. Therefore, you'll need to follow up on those changes.

@lcnr
Copy link
Contributor

lcnr commented Sep 12, 2022

r? @davidtwco

@rust-highfive rust-highfive assigned davidtwco and unassigned lcnr Sep 12, 2022
@davidtwco
Copy link
Member

Are you looking to land this or still working on it?

@finalchild
Copy link
Contributor Author

There's one more file to migrate!

@bors

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@finalchild finalchild force-pushed the ast-passes-diag-2 branch 2 times, most recently from 06989c9 to 55a006f Compare October 14, 2022 08:15
@bors

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@bors

This comment was marked as resolved.

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

Apologies for the delay in reviewing.

pub(crate) reason: &'a DisallowTildeConstContext<'b>,
}

impl<'a> AddToDiagnostic for &'a DisallowTildeConstContext<'_> {
Copy link
Member

Choose a reason for hiding this comment

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

Can't the derive be used for this?

pub suggestion: Vec<(Span, String)>,
}

impl AddToDiagnostic for EqualityConstraintToAssocConstraintSuggestion {
Copy link
Member

Choose a reason for hiding this comment

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

Can the derive be used for this?

*[type_or_const] type and const
} parameters must be declared prior to { $max_param_kind ->
[lifetime] lifetime
*[type_or_const] type and const
Copy link
Member

Choose a reason for hiding this comment

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

Can these be split into multiple Fluent messages to avoid pattern matching on strings?

@bors
Copy link
Contributor

bors commented Nov 24, 2022

☔ The latest upstream changes (presumably #104507) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 21, 2023

☔ The latest upstream changes (presumably #104754) made this pull request unmergeable. Please resolve the merge conflicts.

@finalchild finalchild closed this Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants