Coercepointee validation for: repr transparent, min no. of fields and non generic pointee type constraint - #4950
Open
wesley-lewis wants to merge 4 commits into
Open
wesley-lewis wants to merge 4 commits into
wesley-lewis wants to merge 4 commits into
Conversation
added 4 commits
October 2, 2026 15:58
Member
|
Hello @wesley-lewis ! I think you need to adjust your commits, their logs are empty :). Look at other commits, but feel free to ask if you need help! |
This branch has not been deployed
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.
Fixes #4914
Fixes #4915
Fixes #4916
Added validation checks for
#[derive(CoercePointee)]:repr(transparent)several, exactly one must be marked
#[pointee]Adds error code E0802 for these diagnostics.
For testing:
added following piece to
gcc/rust/expand/rust-derive-coerce-pointee.ccin theDeriveCoercePointee::go (Item &item):Do note that error on the first line of the function has to be commented out.
Run the compiler on the derive coerce pointee test file:
./gcc/crab1 ../gccrs/gcc/testsuite/rust/compile/derive-coerce-pointee1.rs -frust-incomplete-and-experimental-compiler-do-not-use -frust-compat-version=1.84 -frust-debugThe debug log would contain all the errors. For that particular file repr transparent is required and thus the error would point out that.
All the validation checks give the error code E0802 on failure. The content of the error is taken from rustc.
For all 3 tests to fail use the following test file:
make check-rustpasses locallyclang-formatgcc/testsuite/rust/