-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
mGCA: Support array expression as direct const arguments #150786
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
71bf175 to
059e616
Compare
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #150798) made this pull request unmergeable. Please resolve the merge conflicts. |
| let tcx = self.tcx(); | ||
|
|
||
| let array_len = array_expr.elems.len() as u64; | ||
| let elem_ty = self.ty_infer(None, array_expr.span); |
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.
using a ty_infer here isn't quite what you want, this will make it so that using array expressions in type signatures will cause an error due to having _ in your type signature.
it might be useful to look at the recent PR adding support for (N, N2, const { 1 + 1 }) to mgca which has to do very similar logic to what you need to do here: https://github.com/rust-lang/rust/pull/150675/files#diff-ce4273e1e949bf3052de7a08466c4dad785890b24091122954541b615b0ba199R2488-R2513
(you'll probably need to rebase onto latest main too to get the FeedConstTy changes :3)
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.
Thanks for the review! I changed the type infer to use a different method than ty_infer and added related tests.
|
Looks good so far :) thanks for taking this on |
98e4ec6 to
9fdd556
Compare
9fdd556 to
21e092f
Compare
ecca57d to
49b8c2b
Compare
|
HIR ty lowering was modified cc @fmease Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
thanks! @bors r+ rollup |
tracking issue: #132980
resolve: #150612
Support array expression as direct const arguments (e. g. [1, 2, N]) in min_generic_const_args.
todo: