Avoid invalid suggestion in case of macro expansion without inferrable generic type - #161587
Conversation
|
Some changes occurred in need_type_info.rs cc @lcnr |
|
rustbot has assigned @ShoyuVanilla. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
|
@bors reroll |
|
Unknown command "reroll". Run |
|
@rustbot reroll |
There was a problem hiding this comment.
Sorry for the delay, I have been reviewing this 😅
Looks good to me. Thanks!
@bors r+ rollup
Avoid invalid suggestion in case of macro expansion without inferrable generic type Closes rust-lang#129756 . The main challenge for me in this PR was figuring out how to pass down the information of the code being generated from expansion. I went for the simplest approach I could think of, but I questioned myself if the boolean should be placed inside the Visitor. I don't have enough information to figure this out, if it's badly placed I'd be happy to fix and learn! About the test, I split the two commits because we can see the issue being reproduced in the first commit but being fixed on the second. I also added a non-expansion example of the same code to show it won't get altered. Oh, also I didn't know the best place to place the test. I went for the place with same kind of errors, but I guess `proc-macros` could also be a place.
Rollup of 6 pull requests Successful merges: - #162482 (Make `run-make` testsuite work with other codegen backend than LLVM) - #161587 (Avoid invalid suggestion in case of macro expansion without inferrable generic type) - #162363 (Use correct `dir_path` when parsing module from path) - #162408 (add crashtests [7/N]) - #162502 (triagebot: Subscribe me to amdgpu changes) - #162505 (Revert "fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia")
Rollup merge of #161587 - lsunsi:issue129756, r=ShoyuVanilla Avoid invalid suggestion in case of macro expansion without inferrable generic type Closes #129756 . The main challenge for me in this PR was figuring out how to pass down the information of the code being generated from expansion. I went for the simplest approach I could think of, but I questioned myself if the boolean should be placed inside the Visitor. I don't have enough information to figure this out, if it's badly placed I'd be happy to fix and learn! About the test, I split the two commits because we can see the issue being reproduced in the first commit but being fixed on the second. I also added a non-expansion example of the same code to show it won't get altered. Oh, also I didn't know the best place to place the test. I went for the place with same kind of errors, but I guess `proc-macros` could also be a place.
Closes #129756 .
The main challenge for me in this PR was figuring out how to pass down the information of the code being generated from expansion. I went for the simplest approach I could think of, but I questioned myself if the boolean should be placed inside the Visitor. I don't have enough information to figure this out, if it's badly placed I'd be happy to fix and learn!
About the test, I split the two commits because we can see the issue being reproduced in the first commit but being fixed on the second. I also added a non-expansion example of the same code to show it won't get altered.
Oh, also I didn't know the best place to place the test. I went for the place with same kind of errors, but I guess
proc-macroscould also be a place.