-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Migrate rustc_ast_passes diagnostics to SessionDiagnostic
and translatable messages (first part)
#100694
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
r? diagnosics ok high-five is not cooperating. feel free to reassign to wg-diagnostics once this is not in draft mode i guess. |
9dad14f
to
3a7f827
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank
|
SessionDiagnostic
and translatable messagesSessionDiagnostic
and translatable messages (first PR)
While migrating the diagnostics, I had to do some work that might be needed to other contributors too.
The work is far from complete, but it might be better to merge these changes now and open a separate PR for remaining strings. r? rust-lang/diagnostics |
SessionDiagnostic
and translatable messages (first PR)SessionDiagnostic
and translatable messages (first part)
r? @davidtwco |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic! #[fatal(..)]
support is great and will unblock a bunch of others (including me in rustc_incremental
!).
functions in traits cannot be declared `async` | ||
.label = `async` because of this | ||
.note = `async` trait functions are not currently supported | ||
.note2 = consider using the `async-trait` crate: https://crates.io/crates/async-trait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it would be nice if this was slightly more descriptive
@bors r+ |
📌 Commit dd4be85b31556e10fd6c509333b1da7acd18a1b6 has been approved by It is now in the queue for this repository. |
This comment has been minimized.
This comment has been minimized.
r? diagnosics |
r? diagnostics |
@finalchild please be patient when waiting for reviews. it has been less than a day since you requested a follow-up review from davidtwco, and he may not be working on Rust this weekend. |
@bors r+ |
@compiler-errors Sorry, I was just misunderstanding how the command works. 🙏 |
Rollup of 5 pull requests Successful merges: - rust-lang#93162 (Std module docs improvements) - rust-lang#99386 (Add tests that check `Vec::retain` predicate execution order.) - rust-lang#99915 (Recover keywords in trait bounds) - rust-lang#100694 (Migrate rustc_ast_passes diagnostics to `SessionDiagnostic` and translatable messages (first part)) - rust-lang#100757 (Catch overflow early) Failed merges: - rust-lang#99917 (Move Error trait into core) r? `@ghost` `@rustbot` modify labels: rollup
… r=davidtwco Migrate `rustc_plugin_impl` to `SessionDiagnostic` Migration of the `rustc_plugin_impl` crate. ~Draft PR because it is blocked on rust-lang#100694 for `#[fatal(...)]` support~ (this has been merged, and I've changed over to `#[diag(...)]` now too), but I would also like to know if what I did with `LoadPluginError` is okay, because all it does is display the error message from `libloading` ([See conversation on zulip](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.23100717.20diagnostic.20translation/near/294327843)). This crate is apparently for a deprecated feature which is used by servo, so I don't know how much this matters anyway.
… r=davidtwco Migrate `rustc_plugin_impl` to `SessionDiagnostic` Migration of the `rustc_plugin_impl` crate. ~Draft PR because it is blocked on rust-lang#100694 for `#[fatal(...)]` support~ (this has been merged, and I've changed over to `#[diag(...)]` now too), but I would also like to know if what I did with `LoadPluginError` is okay, because all it does is display the error message from `libloading` ([See conversation on zulip](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.23100717.20diagnostic.20translation/near/294327843)). This crate is apparently for a deprecated feature which is used by servo, so I don't know how much this matters anyway.
…s, r=davidtwco save_analysis: Migrate diagnostic * Migrate the `rustc_save_analysis` crate's diagnostic to translatable diagnostic structs. Depends on rust-lang#100694 and rust-lang#100754 for #[fatal(..)] support, then rust-lang@aa68eb4, rust-lang@f5219a3, rust-lang@7da52f6 can be removed. (I copied commits from rust-lang#100754)
…s, r=davidtwco save_analysis: Migrate diagnostic * Migrate the `rustc_save_analysis` crate's diagnostic to translatable diagnostic structs. Depends on rust-lang#100694 and rust-lang#100754 for #[fatal(..)] support, then rust-lang@aa68eb4, rust-lang@f5219a3, rust-lang@7da52f6 can be removed. (I copied commits from rust-lang#100754)
…-session-diagnostic, r=davidtwco Migrate ast lowering to session diagnostic I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see rust-lang#100694).
…-session-diagnostic, r=davidtwco Migrate ast lowering to session diagnostic I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see rust-lang#100694).
…-session-diagnostic, r=davidtwco Migrate ast lowering to session diagnostic I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see rust-lang#100694).
…-session-diagnostic, r=davidtwco Migrate ast lowering to session diagnostic I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see rust-lang#100694).
…-session-diagnostic, r=davidtwco Migrate ast lowering to session diagnostic I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see rust-lang#100694).
…phize, r=davidtwco Migrate rustc_monomorphize to use SessionDiagnostic ### Description - Migrates diagnostics in `rustc_monomorphize` to use `SessionDiagnostic` - Adds an `impl IntoDiagnosticArg for PathBuf` ### TODO / Help! - [x] I'm having trouble figuring out how to apply an optional note. 😕 Help!? - Resolved. It was bad docs. Fixed in https://github.com/rust-lang/rustc-dev-guide/pull/1437/files - [x] `errors:RecursionLimit` should be `#[fatal ...]`, but that doesn't exist so it's `#[error ...]` at the moment. - Maybe I can switch after this is merged in? --> rust-lang#100694 - Or maybe I need to manually implement `SessionDiagnostic` instead of deriving it? - [x] How does one go about converting an error inside of [a call to struct_span_lint_hir](https://github.com/rust-lang/rust/blob/8064a495086c2e63c0ef77e8e82fe3b9b5dc535f/compiler/rustc_monomorphize/src/collector.rs#L917-L927)? - [x] ~What placeholder do you use in the fluent template to refer to the value in a vector? It seems like [this code](https://github.com/rust-lang/rust/blob/0b79f758c9aa6646606662a6d623a0752286cd17/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs#L83-L114) ought to have the answer (or something near it)...but I can't figure it out.~ You can't. Punted.
…phize, r=davidtwco Migrate rustc_monomorphize to use SessionDiagnostic ### Description - Migrates diagnostics in `rustc_monomorphize` to use `SessionDiagnostic` - Adds an `impl IntoDiagnosticArg for PathBuf` ### TODO / Help! - [x] I'm having trouble figuring out how to apply an optional note. 😕 Help!? - Resolved. It was bad docs. Fixed in https://github.com/rust-lang/rustc-dev-guide/pull/1437/files - [x] `errors:RecursionLimit` should be `#[fatal ...]`, but that doesn't exist so it's `#[error ...]` at the moment. - Maybe I can switch after this is merged in? --> rust-lang#100694 - Or maybe I need to manually implement `SessionDiagnostic` instead of deriving it? - [x] How does one go about converting an error inside of [a call to struct_span_lint_hir](https://github.com/rust-lang/rust/blob/8064a495086c2e63c0ef77e8e82fe3b9b5dc535f/compiler/rustc_monomorphize/src/collector.rs#L917-L927)? - [x] ~What placeholder do you use in the fluent template to refer to the value in a vector? It seems like [this code](https://github.com/rust-lang/rust/blob/0b79f758c9aa6646606662a6d623a0752286cd17/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs#L83-L114) ought to have the answer (or something near it)...but I can't figure it out.~ You can't. Punted.
…davidtwco Migrate rustc_monomorphize to use SessionDiagnostic ### Description - Migrates diagnostics in `rustc_monomorphize` to use `SessionDiagnostic` - Adds an `impl IntoDiagnosticArg for PathBuf` ### TODO / Help! - [x] I'm having trouble figuring out how to apply an optional note. 😕 Help!? - Resolved. It was bad docs. Fixed in https://github.com/rust-lang/rustc-dev-guide/pull/1437/files - [x] `errors:RecursionLimit` should be `#[fatal ...]`, but that doesn't exist so it's `#[error ...]` at the moment. - Maybe I can switch after this is merged in? --> rust-lang/rust#100694 - Or maybe I need to manually implement `SessionDiagnostic` instead of deriving it? - [x] How does one go about converting an error inside of [a call to struct_span_lint_hir](https://github.com/rust-lang/rust/blob/8064a495086c2e63c0ef77e8e82fe3b9b5dc535f/compiler/rustc_monomorphize/src/collector.rs#L917-L927)? - [x] ~What placeholder do you use in the fluent template to refer to the value in a vector? It seems like [this code](https://github.com/rust-lang/rust/blob/0b79f758c9aa6646606662a6d623a0752286cd17/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs#L83-L114) ought to have the answer (or something near it)...but I can't figure it out.~ You can't. Punted.
Doing a full migration of the
rustc_ast_passes
crate.Making a draft here since there's not yet a tracking issue for the migrations going on.
@rustbot label +A-translation