Forward struct where-clauses on TransparentWrapper derive - #354
Merged
Conversation
TransparentWrapper skips extra generated bounds, and that path also dropped the type's own where-clause, so a derive on `struct A<T>(T) where T: Trait` failed E0277.
Contributor
Author
Owner
|
There's a successful i686-unknown-linux-gnu, but we may have to just adjust CI. I do recall them announcing that i686 is going down to tier2, so it can probably be set up as a cross-check of some sort. I won't be at my laptop and able to have a more serious look until at least several hours from now. If you want to try and adjust the CI settings you can make that part of this PR. |
Contributor
Author
|
dropped the windows i686 host toolchain cells (rustup 1.29 refuses them on 64-bit runners) and set fail-fast: false. 32-bit stays on the linux cross job. |
rustup 1.29+ refuses stable-i686-gnu on 64-bit windows-latest, and fail-fast cancelled the rest of the matrix. 32-bit stays on the linux cross-test job.
Owner
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#[derive(TransparentWrapper)]drops the struct's own where-clause because TransparentWrapper setsrequires_where_clause()to false and the derive then emitsNoneinstead of the original predicates. Astruct A<T>(T) where T: Traittherefore fails E0277 on the generatedunsafe impl.Snapshot the clause before
add_trait_markerand forward it on that path. Compile-pass coverage isTransparentWithWhereClauseinderive/tests/basic.rs.cargo test --manifest-path derive/Cargo.tomlandcargo test --lib --testsare green. Unfixed main still fails the E0277 repro.