-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improve safe transmute error reporting #109800
Improve safe transmute error reporting #109800
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor These commits modify the If this was intentional then you can ignore this comment. |
cc @jswrenn |
a1e2b22
to
f9b7248
Compare
This comment has been minimized.
This comment has been minimized.
I think I missed some tests that need to be blessed, I’ll do it tomorrow |
tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr
Outdated
Show resolved
Hide resolved
tests/ui/transmutability/enums/should_respect_endianness.stderr
Outdated
Show resolved
Hide resolved
tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr
Outdated
Show resolved
Hide resolved
use @rustbot author |
f9b7248
to
2bbb76b
Compare
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
FYI
|
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/select/confirmation.rs
Outdated
Show resolved
Hide resolved
tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr
Outdated
Show resolved
Hide resolved
abaa6f6
to
5e2e976
Compare
@rustbot ready |
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
Some more comments. Other than those, I'm pretty happy with the state of this PR, though. @rustbot author |
r=me after rebasing there may be some problems with the error reporting with the new trait solver, since we will need to recompute the cannot-transmute-reason on demand in the error reporting code... you can probably just leave that though, I can figure it out, unless you want to. ping me if you need help. |
5ee760b
to
7c49f13
Compare
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
7c49f13
to
6a4b2e8
Compare
Thanks @bryangarza for dealing with many rounds of review. @bors r+ |
📌 Commit 6a4b2e89ff25f85507f603a4724f1ddadc16a1c9 has been approved by It is now in the queue for this repository. |
This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
6a4b2e8
to
36febe1
Compare
@compiler-errors I force pushed a small change after approval (to get |
Force-pushing automatically un-approves your PR. I will re-approve it when CI is green. |
@rustbot ready |
@bors r+ |
…-errors, r=compiler-errors Improve safe transmute error reporting This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#109225 (Clarify that RUST_MIN_STACK may be internally cached) - rust-lang#109800 (Improve safe transmute error reporting) - rust-lang#110158 (Remove obsolete test case) - rust-lang#110180 (don't uniquify regions when canonicalizing) - rust-lang#110207 (Assemble `Unpin` candidates specially for generators in new solver) - rust-lang#110276 (Remove all but one of the spans in `BoundRegionKind::BrAnon`) - rust-lang#110279 (rustdoc: Correctly handle built-in compiler proc-macros as proc-macro and not macro) - rust-lang#110298 (Cover edge cases for {f32, f64}.hypot() docs) - rust-lang#110299 (Switch to `EarlyBinder` for `impl_subject` query) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason.
Also, fix some small bugs that occur when computing the
Answer
for transmutability.