-
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
Fix rustc_ast_pretty print_qpath resulting in invalid macro input #78980
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors r |
📌 Commit 775f1e5 has been approved by |
Fix rustc_ast_pretty print_qpath resulting in invalid macro input related rust-lang#76874 (third case) ### Issue: The input for a procedural macro is incorrect, for the rust code: ```rust mod m { pub trait Tr { type Ts: super::Tu; } } trait Tu { fn dummy() { } } #[may_proc_macro] fn foo() { <T as m::Tr>::Ts::dummy(); } ``` the macro will get the input: ```rust fn foo() { <T as m::Tr>::dummy(); } ``` Thus `Ts` has disappeared. ### Fix: This is due to invalid pretty print of qpath. This PR fix it.
Fix rustc_ast_pretty print_qpath resulting in invalid macro input related rust-lang#76874 (third case) ### Issue: The input for a procedural macro is incorrect, for the rust code: ```rust mod m { pub trait Tr { type Ts: super::Tu; } } trait Tu { fn dummy() { } } #[may_proc_macro] fn foo() { <T as m::Tr>::Ts::dummy(); } ``` the macro will get the input: ```rust fn foo() { <T as m::Tr>::dummy(); } ``` Thus `Ts` has disappeared. ### Fix: This is due to invalid pretty print of qpath. This PR fix it.
Fix rustc_ast_pretty print_qpath resulting in invalid macro input related rust-lang#76874 (third case) ### Issue: The input for a procedural macro is incorrect, for the rust code: ```rust mod m { pub trait Tr { type Ts: super::Tu; } } trait Tu { fn dummy() { } } #[may_proc_macro] fn foo() { <T as m::Tr>::Ts::dummy(); } ``` the macro will get the input: ```rust fn foo() { <T as m::Tr>::dummy(); } ``` Thus `Ts` has disappeared. ### Fix: This is due to invalid pretty print of qpath. This PR fix it.
Rollup of 15 pull requests Successful merges: - rust-lang#78352 (Do not call `unwrap` with `signatures` option enabled) - rust-lang#78590 (refactor: removing alloc::collections::vec_deque ignore-tidy-filelength) - rust-lang#78848 (Bump minimal supported LLVM version to 9) - rust-lang#78856 (Explicitly checking for or-pattern before test) - rust-lang#78948 (test: add `()=()=()=...` to weird-exprs.rs) - rust-lang#78962 (Add a test for r# identifiers) - rust-lang#78963 (Added some unit tests as requested) - rust-lang#78966 (Never inline C variadics, cold functions, functions with incompatible attributes ...) - rust-lang#78968 (Include llvm-as in llvm-tools-preview component) - rust-lang#78969 (Normalize function type during validation) - rust-lang#78980 (Fix rustc_ast_pretty print_qpath resulting in invalid macro input) - rust-lang#78986 (Avoid installing external LLVM dylibs) - rust-lang#78988 (Fix an intrinsic invocation on threaded wasm) - rust-lang#78993 (rustc_target: Fix dash vs underscore mismatches in option names) - rust-lang#79013 (Clean up outdated `use_once_payload` pretty printer comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
related #76874 (third case)
Issue:
The input for a procedural macro is incorrect, for the rust code:
the macro will get the input:
Thus
Ts
has disappeared.Fix:
This is due to invalid pretty print of qpath. This PR fix it.