-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
MGCA: Support literals as direct const arguments #150699
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
MGCA: Support literals as direct const arguments #150699
Conversation
|
|
|
rn this is very basic changes, lots of |
This comment has been minimized.
This comment has been minimized.
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.
This is looking good already! You've touched pretty much everywhere that will be necessary for this change so it's only filling out these todo!s now :)
compiler/rustc_hir/src/intravisit.rs
Outdated
| ConstArgKind::Path(qpath) => visitor.visit_qpath(qpath, *hir_id, qpath.span()), | ||
| ConstArgKind::Anon(anon) => visitor.visit_anon_const(*anon), | ||
| ConstArgKind::Error(_, _) => V::Result::output(), // errors and spans are not important | ||
| ConstArgKind::Literal(_, _) => todo!(), |
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.
In theory we should be calling visitor.visit_lit here. I don't think we actually can right now though as lots of implementers of Visitor expect that visit_lit is only called on literals inside of function bodies.
For now I think you can return the default result with V::Result::output() and leave a // FIXME(mgca) to handle const arg literals in HIR visitors at some point
|
HIR ty lowering was modified cc @fmease Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
|
too bad I have made a merge commit |
This comment has been minimized.
This comment has been minimized.
acd1271 to
78149e6
Compare
This comment has been minimized.
This comment has been minimized.
d60c5dd to
37f084a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
28fc1a0 to
fafe96e
Compare
This comment has been minimized.
This comment has been minimized.
fafe96e to
1d10a8f
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. |
|
@BoxyUwU we are ready to merge |
|
😅 I've noticed i named it MCGA instead of MGCA |
1d10a8f to
9f3956f
Compare
|
@bors r+ rollup there's definitely follow up work here:
so if you're interested in doing more work here that'd be very cool :) |
…oxyUwU MGCA: Support literals as direct const arguments Fixes [rust-lang#150168](rust-lang#150618) - **initial changes for mcga literals** - **rustfmt** r? @BoxyUwU
Rollup of 12 pull requests Successful merges: - #149961 (tidy: add if-installed prefix condition to extra checks system) - #150475 (std: sys: fs: uefi: Implement initial File) - #150533 (std: sys: fs: uefi: Implement remove_dir_all) - #150549 (fix missing_panics_doc in `std::os::fd::owned`) - #150699 (MGCA: Support literals as direct const arguments) - #150721 (Deprecated doc intra link) - #150752 (Update libc to v0.2.180) - #150802 (Minor cleanups to fn_abi_new_uncached) - #150803 (compiler-builtins subtree update) - #150809 (Update `literal-escaper` version to `0.0.7`) - #150811 (Store defids instead of symbol names in the aliases list) - #150825 (Query associated_item_def_ids when needed) r? @ghost
…oxyUwU MGCA: Support literals as direct const arguments Fixes [rust-lang#150168](rust-lang#150618) - **initial changes for mcga literals** - **rustfmt** r? @BoxyUwU
…oxyUwU MGCA: Support literals as direct const arguments Fixes [rust-lang#150168](rust-lang#150618) - **initial changes for mcga literals** - **rustfmt** r? @BoxyUwU
…oxyUwU MGCA: Support literals as direct const arguments Fixes [rust-lang#150168](rust-lang#150618) - **initial changes for mcga literals** - **rustfmt** r? @BoxyUwU
…oxyUwU MGCA: Support literals as direct const arguments Fixes [rust-lang#150168](rust-lang#150618) - **initial changes for mcga literals** - **rustfmt** r? @BoxyUwU
…oxyUwU MGCA: Support literals as direct const arguments Fixes [rust-lang#150168](rust-lang#150618) - **initial changes for mcga literals** - **rustfmt** r? @BoxyUwU
…oxyUwU MGCA: Support literals as direct const arguments Fixes [rust-lang#150168](rust-lang#150618) - **initial changes for mcga literals** - **rustfmt** r? @BoxyUwU
Rollup of 11 pull requests Successful merges: - #149961 (tidy: add if-installed prefix condition to extra checks system) - #150475 (std: sys: fs: uefi: Implement initial File) - #150533 (std: sys: fs: uefi: Implement remove_dir_all) - #150549 (fix missing_panics_doc in `std::os::fd::owned`) - #150699 (MGCA: Support literals as direct const arguments) - #150721 (Deprecated doc intra link) - #150802 (Minor cleanups to fn_abi_new_uncached) - #150803 (compiler-builtins subtree update) - #150809 (Update `literal-escaper` version to `0.0.7`) - #150811 (Store defids instead of symbol names in the aliases list) - #150825 (Query associated_item_def_ids when needed) r? @ghost
Fixes #150168
r? @BoxyUwU