Skip to content
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

Algebraic Datatype Renovation #5183

Closed
wants to merge 37 commits into from
Closed

Conversation

jld
Copy link
Contributor

@jld jld commented Mar 1, 2013

This series of changes moves the representation details of algebraic datatypes (enums, and special cases like structs and tuples and (until they're fully removed) records) from various places around rustc::middle::trans into a single module, to enable future improvements in this area.

r?(@nikomatsakis), and the core developers in general; this seems like a “super-review” kind of change.

@nikomatsakis
Copy link
Contributor

Exciting. I'll take a look.

@nikomatsakis
Copy link
Contributor

OK. So I read through the patches. I think this is great. I would like to see the various comments I mentioned above added in, but otherwise I think it's good to go.

@jld
Copy link
Contributor Author

jld commented Mar 3, 2013

And I think that's all I'm going to stack on this branch as opposed to doing as a followup.

@jld
Copy link
Contributor Author

jld commented Mar 3, 2013

It doesn't merge 100% cleanly anymore, so I have to push a rebase. (I'll keep cc0a88c live, in case anyone wants to do a second-order diff to inspect it; it's just a couple of context changes.)

@jld
Copy link
Contributor Author

jld commented Mar 3, 2013

Don't merge this right now; the rebased version broke the rustpkg tests in a strange way that I don't fully understand and that seems to have something to do with the const enum vector of tests(!).

@jld
Copy link
Contributor Author

jld commented Mar 3, 2013

The bug exists prior to this branch, but a slight change to how enum padding is computed means that it breaks tests instead of going unnoticed. Filed #5210.

@jld
Copy link
Contributor Author

jld commented Mar 5, 2013

Okay. It should work now.

jld added 17 commits March 6, 2013 20:37
…sion.

Later changes on this branch adapt the rest of rustc::middle::trans
to use this module instead of scattered hard-coded knowledge of
representations; a few of them also have improvements or cleanup for
adt.rs (and many added comments) that weren't drastic enough to justify
changing history to move them into this commit.
It causes an LLVM assertion for every host/target word-size combination
on incoming at the time of this writing.
This change remains separate from the addition of adt.rs, even though
it's necessary for compatibility with pre-trans::adt representation,
to serve as an example of a change to the representation logic.
This, like the previous change for unit-like enums, is only necessary
until everything is fully converted to use trans::adt.
The first is reduced from a case in rustdoc (originally involving an
ARC); the other is related.  No committed version has gotten these
wrong, but when I broke them it showed up only in rustdoc; there was
nothing in the test suite (or the compiler!) that failed.

The general issue is that the statics and trans have to agree on order
of evaluation, or else you get use-after-move-out-of errors at runtime.
Note that in the ByValue case (which can't happen? yet?) we're still
effectively bitcasting, I think.  So this change adds a way to assert
that that's safe.

Note also, for future reference, that LLVM's instcombine pass will turn
a bitcast into a GEP(0, 0, ...) if possible.
Also converts const cast-from-enum, because it used the same routine to
get the discriminant as what's renovated to construct the enums.

Also fixes ICE on struct-like variants as consts, and provides a slightly
less bad ICE for functional-update-like struct expressions in consts.
@jld
Copy link
Contributor Author

jld commented Mar 7, 2013

Diff of the actual changes made in the last round, 92b88a1..a69ec17, as a gist because apparently Github only does three-dot diff ranges: https://gist.github.com/jld/c945835fcc861c6b9282

There's a fix for the conflict with 7921810, a fix for some code that was wrong but unreachable until that fix, and a minor issue or two that I'm pretty sure only broke intermediate states along the branch (which I tripped over while trying to test my actual fixups).

bors added a commit that referenced this pull request Mar 7, 2013
This series of changes moves the representation details of algebraic datatypes (enums, and special cases like structs and tuples and (until they're fully removed) records) from various places around rustc::middle::trans into a single module, to enable future improvements in this area.

r?(@nikomatsakis), and the core developers in general; this seems like a “super-review” kind of change.
@bors bors closed this Mar 7, 2013
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
Don't lint `single_component_path_imports` in macros

Fixes rust-lang#5154

changelog: Fix false positive in `single_component_path_imports`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
…shearth,llogiq,flip1995

I like to move it, move it

GHA now runs in the background for 6 days (rust-lang#5088)

Since then ~~15~~ 19 PRs were successfully merged and Travis+Appveyor agreed on the status in every case. ([GitHub PR search query](https://github.com/rust-lang/rust-clippy/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Amerged+merged%3A%3E%3D2020-02-12T15%3A42%3A00+sort%3Aupdated-desc+NOT+%5Bgh-pages%5D+in%3Atitle))

Some PRs were:
- rust-lang#5163
- rust-lang#5170
- rust-lang#5168
- rust-lang#5173
- rust-lang#5171
- rust-lang#5156
- rust-lang#4809
- rust-lang#5177
- rust-lang#5182
- rust-lang#5183
- rust-lang#5184
- rust-lang#5185
- rust-lang#5186
- rust-lang#5181
- rust-lang#5189

Bug with GHA:
- When a rustc PR gets merged between the `integration_build` and the `integration` job, the `integration` job will fail. This happened once in rust-lang#5162, but not in the past 6 days. Even if it would happen every 4th PR we would save time, since splitting up the integration build and tests saves 5-7 minutes per run and a complete run takes 15-17 minutes
- Sometimes the MacOS build takes up to an hour to download the master toolchain. Until now, this happend 2 or 3 times and can be resolved by a `@bors r3try`+canceling the previous run (restarting single jobs is not supported yet)

## Before merging this, rust-lang/rust-central-station#578 has to get merged

This PR is for starting the discussion and to get consensus (@rust-lang/clippy) on a final move to GHA. If we're ready, I'll contact Pietro, to finalize the move.

changelog: Clippy completely runs on GHA now 🎉

---

BTW: The deployment already runs on GHA, instead of Travis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants