Skip to content

hir-analysis: make a helpful note #108337

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 26, 2023

Conversation

tshepang
Copy link
Member

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Feb 22, 2023

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added 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. labels Feb 22, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 22, 2023

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @TaKO8Ki

@@ -5,6 +5,12 @@ LL | #[track_caller]
| ^^^^^^^^^^^^^^^
LL | fn main() {
| --------- `main` function is not allowed to be `#[track_caller]`
|
help: remove the annotation
Copy link
Member

@compiler-errors compiler-errors Feb 22, 2023

Choose a reason for hiding this comment

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

I don't think this being a help note is the best choice.

Preferably it would be a suggestion. If not, then a label is better so that it renders inline.

Copy link
Member Author

Choose a reason for hiding this comment

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

I made an attempt at what you meant

@bors
Copy link
Collaborator

bors commented Feb 22, 2023

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

@tshepang tshepang force-pushed the translatable-hir-analysis branch from a7e5447 to 98805b3 Compare February 22, 2023 22:48
@@ -128,4 +128,4 @@ hir_analysis_auto_deref_reached_recursion_limit = reached the recursion limit wh
.help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`)

hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]`
.label = `main` function is not allowed to be `#[track_caller]`
.label = remove this annotation
Copy link
Member

Choose a reason for hiding this comment

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

For future reference, you can make another label with .label2 = .. or some other name like .removal_label = ... It's probably not best practice to remove existing labels unless they're not useful. I left more comments below for how to make a suggestion, though.

Comment on lines 322 to 334
#[primary_span]
pub span: Span,
#[label]
pub annotated: Span,
Copy link
Member

Choose a reason for hiding this comment

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

#[primary_span]
#[suggestion(applicability = "maybe-incorrect", code = "")]
pub span: Span,
#[label]
pub annotated: Span,

Then make sure the ftl file has a .suggestion = ...

Copy link
Member Author

@tshepang tshepang Feb 23, 2023

Choose a reason for hiding this comment

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

I made a new commit, thanks.

What does "maybe-incorrect" and "machine-applicable" mean?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Please squash this into one commit. Then I can approve.

pub span: Span,
#[label]
#[label(hir_analysis_track_caller_on_main)]
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be turned back into just [label].

Then you can just add ".label = main function is not allowed to be #[track_caller]" back to the ftl file.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it so because it's the exact same text, so did not want to repeat it.

@tshepang tshepang force-pushed the translatable-hir-analysis branch from 38c880f to 570f752 Compare February 23, 2023 18:52
@cjgillot
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Feb 25, 2023

📌 Commit 570f75251b7fb4a0ebc5af46b70c40faaaaf0f4f has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 25, 2023
@bors
Copy link
Collaborator

bors commented Feb 25, 2023

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 25, 2023
@tshepang tshepang force-pushed the translatable-hir-analysis branch from 570f752 to e5d1fcd Compare February 25, 2023 22:02
@cjgillot
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Feb 25, 2023

📌 Commit e5d1fcd has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 25, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 25, 2023
…mpiler-errors

Rollup of 7 pull requests

Successful merges:

 - rust-lang#105736 (Test that the compiler/library builds with validate-mir)
 - rust-lang#107291 ([breaking change] Remove a rustdoc back compat warning)
 - rust-lang#107675 (Implement -Zlink-directives=yes/no)
 - rust-lang#107848 (Split `x setup` sub-actions to CLI arguments)
 - rust-lang#107911 (Add check for invalid #[macro_export] arguments)
 - rust-lang#108229 ([107049] Recognise top level keys in config.toml.example)
 - rust-lang#108333 (Make object bound candidates sound in the new trait solver)

Failed merges:

 - rust-lang#108337 (hir-analysis: make a helpful note)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#107941 (Treat `str` as containing `[u8]` for auto trait purposes)
 - rust-lang#108299 (Require `literal`s for some `(u)int_impl!` parameters)
 - rust-lang#108337 (hir-analysis: make a helpful note)
 - rust-lang#108379 (Add `ErrorGuaranteed` to `hir::{Expr,Ty}Kind::Err` variants)
 - rust-lang#108418 (Replace parse_[sth]_expr with parse_expr_[sth] function names)
 - rust-lang#108424 (rustc_infer: Consolidate obligation elaboration de-duplication)
 - rust-lang#108475 (Fix `VecDeque::shrink_to` and add tests.)
 - rust-lang#108482 (statically guarantee that current error codes are documented)
 - rust-lang#108484 (Remove `from` lang item)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b27f37d into rust-lang:master Feb 26, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 26, 2023
@tshepang tshepang deleted the translatable-hir-analysis branch February 26, 2023 15:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants