-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: Lower all const paths as ConstArgKind::Path
#135186
Conversation
This comment has been minimized.
This comment has been minimized.
c501669
to
4efbed3
Compare
This comment has been minimized.
This comment has been minimized.
4efbed3
to
0036c2c
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.
ConstArgKind::Path
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.
thx for working on this :3
263637d
to
a296ff8
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #135896) made this pull request unmergeable. Please resolve the merge conflicts. |
a5a9370
to
ece9e77
Compare
ConstArgKind::Path
ConstArgKind::Path
☔ The latest upstream changes (presumably #136024) made this pull request unmergeable. Please resolve the merge conflicts. |
7cbecce
to
50bd398
Compare
☔ The latest upstream changes (presumably #135726) made this pull request unmergeable. Please resolve the merge conflicts. |
abe7d68
to
991f55c
Compare
A bit tricky to support this special case now, so might as well save it for once we're ready to handle the general case. See rust-lang#135186 (comment). Co-authored-by: BoxyUwU <[email protected]>
lgtm, once you've squashed the commits ill r+ (and probably should update the PR description/title) |
ConstArgKind::Path
ConstArgKind::Path
When `#![feature(min_generic_const_args)]` is enabled, we now lower all const paths in generic arg position to `hir::ConstArgKind::Path`. We then lower assoc const paths to `ty::ConstKind::Unevaluated` since we can no longer use the anon const expression lowering machinery. In the process of implementing this, I factored out `hir_ty_lowering` code that is now shared between lowering assoc types and assoc consts. This PR also introduces a `#[type_const]` attribute for trait assoc consts that are allowed as const args. However, we still need to implement code to check that assoc const definitions satisfy `#[type_const]` if present (basically is it a const path or a monomorphic anon const).
c082ce1
to
177e7ff
Compare
@bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (08db600): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 0.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 778.226s -> 775.839s (-0.31%) |
When
#![feature(min_generic_const_args)]
is enabled, we now lower allconst paths in generic arg position to
hir::ConstArgKind::Path
. Wethen lower assoc const paths to
ty::ConstKind::Unevaluated
since wecan no longer use the anon const expression lowering machinery. In the
process of implementing this, I factored out
hir_ty_lowering
code thatis now shared between lowering assoc types and assoc consts.
This PR also introduces a
#[type_const]
attribute for trait assocconsts that are allowed as const args. However, we still need to
implement code to check that assoc const definitions satisfy
#[type_const]
if present (basically is it a const path or amonomorphic anon const).
r? @BoxyUwU