-
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
Use ConstArgKind::Path
for all single-segment paths, not just params under min_generic_const_args
#131081
base: master
Are you sure you want to change the base?
Conversation
2b73426
to
87b1f29
Compare
This comment has been minimized.
This comment has been minimized.
c43d981
to
883a4ba
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #131628) made this pull request unmergeable. Please resolve the merge conflicts. |
23076d2
to
507ada1
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #130950) made this pull request unmergeable. Please resolve the merge conflicts. |
4494a71
to
034661e
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.
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.
ConstArgKind::Path
for all paths, not just paramsConstArgKind::Path
for all single-segment paths, not just params
HIR ty lowering was modified cc @fmease |
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.
✨ thanks for working on this, excited to be able to add the min_generic_const_args
feature gate soon after all of these refactorings 😅
☔ The latest upstream changes (presumably #132371) made this pull request unmergeable. Please resolve the merge conflicts. |
bf17503
to
8b260ba
Compare
This comment has been minimized.
This comment has been minimized.
283bd54
to
2fe91f2
Compare
Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
87790f1
to
317465c
Compare
This comment has been minimized.
This comment has been minimized.
@@ -2025,23 +2040,138 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { | |||
/// | |||
/// Early-bound const parameters get lowered to [`ty::ConstKind::Param`] | |||
/// and late-bound ones to [`ty::ConstKind::Bound`]. | |||
pub(crate) fn lower_const_param(&self, hir_id: HirId) -> Const<'tcx> { |
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.
how come this was changed. I think it would be nicer to keep it the same as it was since lower_ty_param
also doesn't take a DefId
also you'll need to squash all these commits before merging |
Co-authored-by: Boxy UwU <[email protected]> Co-authored-by: León Orell Valerian Liehr <[email protected]>
bf37eb4
to
59e339f
Compare
ConstArgKind::Path
for all single-segment paths, not just paramsConstArgKind::Path
for all single-segment paths, not just params under min_generic_const_params
ConstArgKind::Path
for all single-segment paths, not just params under min_generic_const_params
ConstArgKind::Path
for all single-segment paths, not just params under min_generic_const_args
This comment has been minimized.
This comment has been minimized.
rebased and squashed commits for you as well as blessing the stable mir test now that those changes have been reverted. we can follow up on everything else later. Having the feature gate will be super nice thanks :3 @bors r+ |
Use `ConstArgKind::Path` for all single-segment paths, not just params under `min_generic_const_args` r? `@BoxyUwU` edit by `@BoxyUwU:` This PR introduces a `min_generic_const_args` feature gate and implements some preliminary work for it, representing all const arguments that are single segment paths as `ConstArg::Path` instead of only those that resolve to a const generic parameter. There are a few bits of follow up work after this lands: - Figure out how to represent `Foo<{ STATIC }>` - Figure out how to evaluate `Foo<{ EnumVariantConstructor }>` - Make param env normalization handle non-anon-consts - Move `try_from_lit` and `from_anon_const` to hir ty lowering too
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#131081 (Use `ConstArgKind::Path` for all single-segment paths, not just params under `min_generic_const_args`) - rust-lang#132577 (Report the `unexpected_cfgs` lint in external macros) - rust-lang#133023 (Merge `-Zhir-stats` into `-Zinput-stats`) - rust-lang#133200 (ignore an occasionally-failing test in Miri) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#131081 (Use `ConstArgKind::Path` for all single-segment paths, not just params under `min_generic_const_args`) - rust-lang#132577 (Report the `unexpected_cfgs` lint in external macros) - rust-lang#133023 (Merge `-Zhir-stats` into `-Zinput-stats`) - rust-lang#133200 (ignore an occasionally-failing test in Miri) r? `@ghost` `@rustbot` modify labels: rollup
r? @BoxyUwU
edit by @BoxyUwU:
This PR introduces a
min_generic_const_args
feature gate and implements some preliminary work for it, representing all const arguments that are single segment paths asConstArg::Path
instead of only those that resolve to a const generic parameter. There are a few bits of follow up work after this lands:Foo<{ STATIC }>
Foo<{ EnumVariantConstructor }>
try_from_lit
andfrom_anon_const
to hir ty lowering too