-
Notifications
You must be signed in to change notification settings - Fork 14k
mgca: Add ConstArg representation for const items #139558
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
Conversation
This comment has been minimized.
This comment has been minimized.
fa42f86 to
6054bd5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ac73a4a to
4f6c9ab
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.
|
☔ The latest upstream changes (presumably #141343) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@oli-obk I've assigned you to this PR alongside me because I'd definitely want you to review it before it lands since its so CTFE involved 🤔 I don't think it needs reviewing rn though, things are so up in the air and we're not bootstrapping yet :3 |
When mgca is enabled, const rhs's that are paths may have false negatives with the lints in non_copy_const.rs. But these should probably be using the trait solver anyway, and it only happens under mgca.
Also removed a test that was literally a duplicate of the one I kept.
8d22925 to
45391bd
Compare
|
@bors r=oli-obk,BoxyUwU rollup=never |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing fb23dd3 (parent) -> 72b21e1 (this PR) Test differencesShow 316 test diffsStage 1
Stage 2
Additionally, 292 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 72b21e1a64dbbbb3b59ac7ce21363c366a894b79 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (72b21e1): comparison URL. Overall result: ❌ regressions - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 476.932s -> 476.758s (-0.04%) |
tracking issue: #132980
fixes #131046
fixes #134641
As part of implementing
min_generic_const_args, we need to distinguish const items that can be used in the type system, such as in associated const equality projections, from const items containing arbitrary const code, which must be kept out of the type system. Specifically, all "type consts" must be either concrete (no generics) or generic with a trivial expression likeNor a path to another type const item.To syntactically distinguish these cases, we require, for now at least, that users annotate all type consts with the
#[type_const]attribute. Then, we validate that the const's right-hand side is indeed eligible to be a type const and represent it differently in the HIR.We accomplish this representation using a new
ConstItemRhsenum in the HIR, and a similar but simpler enum in the AST. When#[type_const]is not applied to a const (e.g. on stable), we represent const item right-hand sides (rhs's) as HIR bodies, like before. However, when the attribute is applied, we instead lower to ahir::ConstArg. This syntactically distinguishes between trivial const args (paths) and arbitrary expressions, which are represented usingAnonConsts. Then ingenerics_of, we can take advantage of the existing machinery to bar theAnonConstrhs's from using parent generics.