-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make casts of pointers to trait objects stricter #120248
Merged
Merged
Commits on Jul 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 36b1f44 - Browse repository at this point
Copy the full SHA 36b1f44View commit details -
Forbid casts of raw pointers to trait objects with the same trait, bu…
…t different args
Configuration menu - View commit details
-
Copy full SHA for d06cf5b - Browse repository at this point
Copy the full SHA d06cf5bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e8ef92 - Browse repository at this point
Copy the full SHA 9e8ef92View commit details -
Add more checks for pointers with vtable meta
The rules for casting `*mut X<dyn A>` -> `*mut Y<dyn B>` are as follows: - If `B` has a principal - `A` must have exactly the same principal (including generics) - Auto traits of `B` must be a subset of autotraits in `A` Note that `X<_>` and `Y<_>` can be identity, or arbitrary structs with last field being the dyn type. The lifetime of the trait object itself (`dyn ... + 'a`) is not checked. This prevents a few soundness issues with `#![feature(arbitrary_self_types)]` and trait upcasting. Namely, these checks make sure that vtable is always valid for the pointee.
Configuration menu - View commit details
-
Copy full SHA for 5645e8e - Browse repository at this point
Copy the full SHA 5645e8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for bb651d3 - Browse repository at this point
Copy the full SHA bb651d3View commit details -
Disallow
dyn Trait -> dyn Auto
backI think it's fine, but let's ask T-lang separately.
Configuration menu - View commit details
-
Copy full SHA for eac4916 - Browse repository at this point
Copy the full SHA eac4916View commit details -
Configuration menu - View commit details
-
Copy full SHA for e85295c - Browse repository at this point
Copy the full SHA e85295cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c743557 - Browse repository at this point
Copy the full SHA c743557View commit details -
Configuration menu - View commit details
-
Copy full SHA for 340d69b - Browse repository at this point
Copy the full SHA 340d69bView commit details -
Delete
CloneAny
fromrust-analyzer
's fork ofAnyMap
...because it's very sketchy and causes FCWs. In this case it *is* actually sound, but still. I should write a better fork of anymap...
Configuration menu - View commit details
-
Copy full SHA for 06863ee - Browse repository at this point
Copy the full SHA 06863eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf7032f - Browse repository at this point
Copy the full SHA cf7032fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b16f803 - Browse repository at this point
Copy the full SHA b16f803View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc420a2 - Browse repository at this point
Copy the full SHA dc420a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52ba120 - Browse repository at this point
Copy the full SHA 52ba120View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ef533e - Browse repository at this point
Copy the full SHA 9ef533eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a1f20f1 - Browse repository at this point
Copy the full SHA a1f20f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 56de9da - Browse repository at this point
Copy the full SHA 56de9daView commit details
Commits on Jul 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 073f3a2 - Browse repository at this point
Copy the full SHA 073f3a2View commit details
Commits on Jul 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f3c13bf - Browse repository at this point
Copy the full SHA f3c13bfView commit details
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.