-
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
Improve proc macro attribute diagnostics #106407
Conversation
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. |
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 Examples of
|
let output = sig.output().skip_binder(); | ||
|
||
// Typecheck the output | ||
if tcx.normalize_erasing_regions(ParamEnv::empty(), output) != tokenstream { |
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.
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
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.
Then you can normalize the whole signature together, rather than normalizing types per argument below.
This is good for now I guess, would prefer if we used real inference but oh well! @bors r+ |
Improve proc macro attribute diagnostics Closes rust-lang#102923
@bors r- proc macro tests need to be disabled on platforms that don't support them.. |
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
@bors r+ |
Improve proc macro attribute diagnostics Closes rust-lang#102923
Improve proc macro attribute diagnostics Closes rust-lang#102923
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#106407 (Improve proc macro attribute diagnostics) - rust-lang#106960 (Teach parser to understand fake anonymous enum syntax) - rust-lang#107085 (Custom MIR: Support binary and unary operations) - rust-lang#107086 (Print PID holding bootstrap build lock on Linux) - rust-lang#107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`) - rust-lang#107204 (suggest qualifying bare associated constants) - rust-lang#107248 (abi: add AddressSpace field to Primitive::Pointer ) - rust-lang#107272 (Implement ObjectSafe and WF in the new solver) - rust-lang#107285 (Implement `Generator` and `Future` in the new solver) - rust-lang#107286 (ICE in new solver if we see an inference variable) - rust-lang#107313 (Add Style Team Triagebot config) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#106407 (Improve proc macro attribute diagnostics) - rust-lang#106960 (Teach parser to understand fake anonymous enum syntax) - rust-lang#107085 (Custom MIR: Support binary and unary operations) - rust-lang#107086 (Print PID holding bootstrap build lock on Linux) - rust-lang#107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`) - rust-lang#107204 (suggest qualifying bare associated constants) - rust-lang#107248 (abi: add AddressSpace field to Primitive::Pointer ) - rust-lang#107272 (Implement ObjectSafe and WF in the new solver) - rust-lang#107285 (Implement `Generator` and `Future` in the new solver) - rust-lang#107286 (ICE in new solver if we see an inference variable) - rust-lang#107313 (Add Style Team Triagebot config) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Closes #102923