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

Migrate rustc_resolve to use SessionDiagnostic, part # 1 #101162

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

rajputrajat
Copy link
Contributor

crate a somewhat on larger size, so plz allow some time to get it finished.

@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 Aug 29, 2022
@rustbot
Copy link
Collaborator

rustbot commented Aug 29, 2022

rustc_error_messages was changed

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

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @fee1-dead (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 29, 2022
@compiler-errors
Copy link
Member

@rajputrajat, can you please remove all of these merge commits? We have a no merge commit policy.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

@rajputrajat -- I think you need to do something like git pull --rebase $REMOTE master where $REMOTE is the git remote corresponding to upstream, i.e. the rust-lang/rust repo (not your fork).

@rajputrajat
Copy link
Contributor Author

Yes. I will update this as you suggested.
Being a first timer, I did read this comment somewhere on some other PR but didn't understand it then.

Thanks!

@fee1-dead
Copy link
Member

r? @davidtwco

@rust-highfive rust-highfive assigned davidtwco and unassigned fee1-dead Aug 30, 2022
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.

This is a great start, I've left some comments, you'll need to remove the merge commits as @compiler-errors has noted. :)

compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/errors.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/errors.rs Outdated Show resolved Hide resolved
@bors

This comment was marked as resolved.

@rustbot
Copy link
Collaborator

rustbot commented Sep 3, 2022

Some changes occurred in src/tools/cargo

cc @ehuss

The Miri submodule was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

RalfJung commented Sep 4, 2022

Looks like something went wrong in the rebase, this contains a bunch of changes it shouldn't (submodules, lockfile).

@rust-log-analyzer

This comment has been minimized.

@rajputrajat rajputrajat force-pushed the master branch 2 times, most recently from 30f6b99 to 2f600ec Compare September 5, 2022 19:43
@davidtwco
Copy link
Member

You should run ./x.py test src/test/ui locally and try to resolve the test failures as you go - so that the diagnostics you are migrating continue to work :)

@rajputrajat
Copy link
Contributor Author

This looks good to me, apologies for the delay in reviewing, just one minor comment - would appreciate if you could squash some of the commits too.

Done. Please review.

@rajputrajat
Copy link
Contributor Author

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

Wrong commits were picked while squashing. corrected!

compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/diagnostics.rs Show resolved Hide resolved
compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
Some(errs::UnreachableLabelSubLabel { ident_span: ident.span }),
Some(errs::UnreachableLabelSubSuggestion {
span,
ident_name: ident.name,
Copy link
Member

Choose a reason for hiding this comment

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

..likewise here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this one being used in 'suggestion', so seems like need to leave as is.

);
err
path_span: path.span,
path_str: pprust::path_to_string(&path),
Copy link
Member

Choose a reason for hiding this comment

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

This might be another case where we can use IntoDiagnosticArg and embed the meaningful type directly in the error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that string is part of a suggestion, so need to leave as is.

Applicability::MaybeIncorrect,
);
err
path_span: path.span,
Copy link
Member

Choose a reason for hiding this comment

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

Just a note for myself: we should have a IntoDiagnosticSpan trait and use that for all the various types that contain spans, like paths here or Ident.

compiler/rustc_resolve/src/diagnostics.rs Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

implement binding_shadows

migrate till self-in-generic-param-default

use braces in fluent message as suggested by @compiler-errors.

to fix lock file issue reported by CI

migrate 'unreachable label' error

run formatter

name the variables correctly in fluent file

SessionDiagnostic -> Diagnostic

test "pattern/pat-tuple-field-count-cross.rs" passed

test "resolve/bad-env-capture2.rs" passed

test "enum/enum-in-scope.rs" and other depended on "resolve_binding_shadows_something_unacceptable" should be passed now.

fix crash errors while running test-suite. there might be more.

then_some(..) suits better here.

all tests passed

convert TraitImpl and InvalidAsm. TraitImpl is buggy yet. will fix after receiving help from Zulip

migrate "Ralative-2018"

migrate "ancestor only"

migrate "expected found"

migrate "Indeterminate"

migrate "module only"

revert to the older implementation for now. since this is failing at the moment.

follow the convension for fluent variable

order the diag attribute as suggested in review comment

fix merge error. migrate trait-impl-duplicate

make the changes compatible with "Flatten diagnostic slug modules rust-lang#103345"

fix merge

remove commented code

merge issues

fix review comments

fix tests
@rajputrajat rajputrajat force-pushed the master branch 2 times, most recently from 37a7e9d to 269ce36 Compare November 13, 2022 14:19
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 15, 2022

📌 Commit 269ce36 has been approved by davidtwco

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 Nov 15, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Nov 16, 2022
Migrate rustc_resolve to use SessionDiagnostic, part # 1

crate a somewhat on larger size, so plz allow some time to get it finished.
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 16, 2022
Migrate rustc_resolve to use SessionDiagnostic, part # 1

crate a somewhat on larger size, so plz allow some time to get it finished.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1)
 - rust-lang#103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting))
 - rust-lang#103405 (Detect incorrect chaining of if and if let conditions and recover)
 - rust-lang#103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets)
 - rust-lang#104006 (Add variant_name function to `LangItem`)
 - rust-lang#104494 (Migrate GUI test to use functions)
 - rust-lang#104516 (rustdoc: clean up sidebar width CSS)
 - rust-lang#104550 (fix a typo)

Failed merges:

 - rust-lang#104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3e59657 into rust-lang:master Nov 18, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 18, 2022
@bors
Copy link
Contributor

bors commented Nov 18, 2022

☔ The latest upstream changes (presumably #104573) 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 Nov 18, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 21, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1)
 - rust-lang#103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting))
 - rust-lang#103405 (Detect incorrect chaining of if and if let conditions and recover)
 - rust-lang#103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets)
 - rust-lang#104006 (Add variant_name function to `LangItem`)
 - rust-lang#104494 (Migrate GUI test to use functions)
 - rust-lang#104516 (rustdoc: clean up sidebar width CSS)
 - rust-lang#104550 (fix a typo)

Failed merges:

 - rust-lang#104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)

r? `@ghost`
`@rustbot` modify labels: rollup
@aDotInTheVoid aDotInTheVoid removed the A-rustdoc-json Area: Rustdoc JSON backend label Dec 27, 2022
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-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.