Repository navigation
autodiff: don't ICE on invalid macro arguments - #166196
Conversation
|
Some changes occurred in compiler/rustc_builtin_macros/src/autodiff.rs cc @ZuseZ4 |
|
Thanks for the pull request, and welcome! The Rust Project has assigned @tmiasko (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
ef286ef to
78cfd0b
Compare
|
This PR changes a file inside |
|
r? ZuseZ4 |
This comment has been minimized.
This comment has been minimized.
|
Thank you, while reviewing this PR I noticed two issues that I quickly fixed last night. If you can rebase onto the latest main and force-push, then I can have another look at this PR |
b519f41 to
b5d04d2
Compare
|
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. |
|
@ZuseZ4 Rebased onto the latest main. Thanks for taking a look. |
|
Thanks. The In general, the code tries to emit as many errors at once as possible (to shorten debug cycles), but if the count mismatches, we cannot reliably match activities to arguments to begin with, so it seems sensible to error earlier. @bors r+ rollup |
…args, r=ZuseZ4 autodiff: don't ICE on invalid macro arguments Fixes rust-lang#150326 Fixes rust-lang#150327 Fixes rust-lang#150329 Fixes rust-lang#160329 The generated function name must now be a single identifier. Activities that aren't identifiers get the existing "did not recognize Activity" error. A function with a return type but no activities gets the existing activity count error, and expansion stops there. In rust-lang#160329, parser recovery leaves the function with more parameters than activities. That case now stops at the count error, so its crash test moves to `tests/ui/autodiff`.
…args, r=ZuseZ4 autodiff: don't ICE on invalid macro arguments Fixes rust-lang#150326 Fixes rust-lang#150327 Fixes rust-lang#150329 Fixes rust-lang#160329 The generated function name must now be a single identifier. Activities that aren't identifiers get the existing "did not recognize Activity" error. A function with a return type but no activities gets the existing activity count error, and expansion stops there. In rust-lang#160329, parser recovery leaves the function with more parameters than activities. That case now stops at the count error, so its crash test moves to `tests/ui/autodiff`.
…args, r=ZuseZ4 autodiff: don't ICE on invalid macro arguments Fixes rust-lang#150326 Fixes rust-lang#150327 Fixes rust-lang#150329 Fixes rust-lang#160329 The generated function name must now be a single identifier. Activities that aren't identifiers get the existing "did not recognize Activity" error. A function with a return type but no activities gets the existing activity count error, and expansion stops there. In rust-lang#160329, parser recovery leaves the function with more parameters than activities. That case now stops at the count error, so its crash test moves to `tests/ui/autodiff`.
…uwer Rollup of 7 pull requests Successful merges: - #164252 (Share retain implementation between Vec and VecDeque) - #166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - #166506 (traits: Fix dead match arm for String type suggestions.) - #164542 (Add regression test for #151312) - #165651 (compiletest: Further clean up directive parsing) - #166196 (autodiff: don't ICE on invalid macro arguments) - #166556 (remove `Box::into_boxed_slice`)
…uwer Rollup of 10 pull requests Successful merges: - #164252 (Share retain implementation between Vec and VecDeque) - #166008 (fix inconsistent precedence of -Ctarget-feature wrt -Zllvm-target-feature) - #166156 (tests: cover proc-macro metadata path remapping) - #166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - #166506 (traits: Fix dead match arm for String type suggestions.) - #164542 (Add regression test for #151312) - #165651 (compiletest: Further clean up directive parsing) - #166196 (autodiff: don't ICE on invalid macro arguments) - #166556 (remove `Box::into_boxed_slice`) - #166562 (docs: add backticks around `!` in primitive docs )
…uwer Rollup of 10 pull requests Successful merges: - #164252 (Share retain implementation between Vec and VecDeque) - #166008 (fix inconsistent precedence of -Ctarget-feature wrt -Zllvm-target-feature) - #166156 (tests: cover proc-macro metadata path remapping) - #166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - #166506 (traits: Fix dead match arm for String type suggestions.) - #164542 (Add regression test for #151312) - #165651 (compiletest: Further clean up directive parsing) - #166196 (autodiff: don't ICE on invalid macro arguments) - #166556 (remove `Box::into_boxed_slice`) - #166562 (docs: add backticks around `!` in primitive docs )
Rollup merge of #166196 - puranikyashaswin:autodiff-invalid-args, r=ZuseZ4 autodiff: don't ICE on invalid macro arguments Fixes #150326 Fixes #150327 Fixes #150329 Fixes #160329 The generated function name must now be a single identifier. Activities that aren't identifiers get the existing "did not recognize Activity" error. A function with a return type but no activities gets the existing activity count error, and expansion stops there. In #160329, parser recovery leaves the function with more parameters than activities. That case now stops at the count error, so its crash test moves to `tests/ui/autodiff`.
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#164252 (Share retain implementation between Vec and VecDeque) - rust-lang/rust#166008 (fix inconsistent precedence of -Ctarget-feature wrt -Zllvm-target-feature) - rust-lang/rust#166156 (tests: cover proc-macro metadata path remapping) - rust-lang/rust#166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - rust-lang/rust#166506 (traits: Fix dead match arm for String type suggestions.) - rust-lang/rust#164542 (Add regression test for rust-lang/rust#151312) - rust-lang/rust#165651 (compiletest: Further clean up directive parsing) - rust-lang/rust#166196 (autodiff: don't ICE on invalid macro arguments) - rust-lang/rust#166556 (remove `Box::into_boxed_slice`) - rust-lang/rust#166562 (docs: add backticks around `!` in primitive docs )
Fixes #150326
Fixes #150327
Fixes #150329
Fixes #160329
The generated function name must now be a single identifier. Activities that aren't identifiers get the existing "did not recognize Activity" error. A function with a return type but no activities gets the existing activity count error, and expansion stops there.
In #160329, parser recovery leaves the function with more parameters than activities. That case now stops at the count error, so its crash test moves to
tests/ui/autodiff.