Skip to content

Improve proc macro attribute diagnostics - #106407

Merged
bors merged 3 commits into
rust-lang:masterfrom
mejrs:attr_check
Jan 26, 2023
Merged

bors merged 3 commits into
rust-lang:masterfrom
mejrs:attr_check

Conversation

@mejrs

@mejrs mejrs commented Jan 3, 2023

Copy link
Copy Markdown
Member

Closes #102923

@rustbot

rustbot commented Jan 3, 2023

Copy link
Copy Markdown
Collaborator

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

Please see the contribution instructions for more information.

@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 Jan 3, 2023
@rustbot

rustbot commented Jan 3, 2023

Copy link
Copy Markdown
Collaborator

rustc_error_messages was changed

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

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

Comment thread compiler/rustc_passes/src/check_attr.rs Resolved
Comment thread compiler/rustc_passes/src/check_attr.rs Resolved
Comment thread compiler/rustc_passes/src/check_attr.rs Outdated
Comment on lines 2119 to 2122

ghost Jan 3, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not generally ok to normalize a type after skipping its binders.

You should liberate the function signature of its binder first: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.liberate_late_bound_regions

ghost Jan 3, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Then you can normalize the whole signature together, rather than normalizing types per argument below.

Comment thread compiler/rustc_passes/src/check_attr.rs Resolved
Comment thread compiler/rustc_passes/src/check_attr.rs Resolved
@oli-obk

ghost commented Jan 9, 2023

Copy link
Copy Markdown
Contributor

r? @compiler-errors

@rustbot rustbot assigned compiler-errors and unassigned oli-obk Jan 9, 2023
@compiler-errors

ghost commented Jan 18, 2023

Copy link
Copy Markdown
Contributor

This is good for now I guess, would prefer if we used real inference but oh well!

@bors r+

@bors

ghost commented Jan 18, 2023

Copy link
Copy Markdown
Contributor

📌 Commit a8e3abd has been approved by compiler-errors

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 Jan 18, 2023
@compiler-errors

ghost commented Jan 18, 2023

Copy link
Copy Markdown
Contributor

@bors r-

#107017 (comment)

proc macro tests need to be disabled on platforms that don't support them..

@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 Jan 18, 2023
@mejrs

ghost commented Jan 19, 2023

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 19, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

ghost commented Jan 22, 2023

Copy link
Copy Markdown
Contributor

@bors r+

@bors

ghost commented Jan 22, 2023

Copy link
Copy Markdown
Contributor

📌 Commit 8e43414 has been approved by compiler-errors

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 Jan 22, 2023
@bors
bors merged commit 8ae5116 into rust-lang:master Jan 26, 2023
@rustbot rustbot added this to the 1.69.0 milestone Jan 26, 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-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.

Better diagnostics for proc macro attributes

8 participants