Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Forward struct where-clauses on TransparentWrapper derive - #354

Merged
Lokathor merged 2 commits into
Lokathor:mainfrom
teddytennant:wrangle-bt-a
Sep 11, 2026
Merged

Forward struct where-clauses on TransparentWrapper derive#354
Lokathor merged 2 commits into
Lokathor:mainfrom
teddytennant:wrangle-bt-a

Conversation

@teddytennant

Copy link
Copy Markdown
Contributor

#[derive(TransparentWrapper)] drops the struct's own where-clause because TransparentWrapper sets requires_where_clause() to false and the derive then emits None instead of the original predicates. A struct A<T>(T) where T: Trait therefore fails E0277 on the generated unsafe impl.

Snapshot the clause before add_trait_marker and forward it on that path. Compile-pass coverage is TransparentWithWhereClause in derive/tests/basic.rs.

cargo test --manifest-path derive/Cargo.toml and cargo test --lib --tests are green. Unfixed main still fails the E0277 repro.

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.
@teddytennant

Copy link
Copy Markdown
Contributor Author

The matrix fail-fasted on stable-i686-gnu (windows): rustup 1.29.1 now refuses that host toolchain (may not be able to run on this system) before cargo runs. Same job was green on main in August (7cc6738) and on #353. The 1.71 / windows-stable logs that did start still show test result: ok.

@Lokathor

Lokathor commented Sep 9, 2026

Copy link
Copy Markdown
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.

@teddytennant

Copy link
Copy Markdown
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.
@Lokathor Lokathor added semver-patch semver patch change semver-derive We need to update the main crate's use of the derive crate labels Sep 9, 2026
@Lokathor
Lokathor merged commit 9b27324 into Lokathor:main Sep 11, 2026
13 checks passed
@Lokathor

Copy link
Copy Markdown
Owner

bytemuck_derive-v1.12.1 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-derive We need to update the main crate's use of the derive crate semver-patch semver patch change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants