-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Normalize struct tail properly for dyn
ptr-to-ptr casting in new solver
#128712
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
dyn
ptr-to-ptr castingdyn
ptr-to-ptr casting in new solver
if self.infcx.next_trait_solver() { | ||
let body = self.body; | ||
let param_env = self.param_env; | ||
self.fully_perform_op( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incredibly gross, to the point that it kinda feels unnecessary? 🤔 But I really don't know how to simplify it, given the way that we need to wrap this in a type op and struct_tail
doesn't have a fallible normalize fn...
☔ The latest upstream changes (presumably #128707) made this pull request unmergeable. Please resolve the merge conflicts. |
97232bf
to
f15997f
Compare
@@ -226,7 +226,7 @@ pub(super) fn op_to_const<'tcx>( | |||
let pointee_ty = imm.layout.ty.builtin_deref(false).unwrap(); // `false` = no raw ptrs | |||
debug_assert!( | |||
matches!( | |||
ecx.tcx.struct_tail_without_normalization(pointee_ty).kind(), | |||
ecx.tcx.struct_tail_for_codegen(pointee_ty, ecx.param_env).kind(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't actually create a test for this, since we only allow matching on arrays and str (not tails), and I don't know how to trigger this outside of MIR match lowering.
@bors r+ |
…, r=lcnr Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver Realized that the new solver didn't handle ptr-to-ptr casting correctly. r? lcnr Built on rust-lang#128694
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#128712 (Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver) - rust-lang#128878 (Slightly refactor `Flags` in bootstrap) - rust-lang#128886 (Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`) - rust-lang#128912 (Store `do_not_recommend`-ness in impl header) - rust-lang#128936 (Support reading thin archives in ArArchiveBuilder) - rust-lang#128937 (Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`) - rust-lang#128978 (Use `assert_matches` around the compiler more) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#128712 (Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver) - rust-lang#128878 (Slightly refactor `Flags` in bootstrap) - rust-lang#128886 (Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`) - rust-lang#128912 (Store `do_not_recommend`-ness in impl header) - rust-lang#128936 (Support reading thin archives in ArArchiveBuilder) - rust-lang#128937 (Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`) - rust-lang#128978 (Use `assert_matches` around the compiler more) r? `@ghost` `@rustbot` modify labels: rollup
…, r=lcnr Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver Realized that the new solver didn't handle ptr-to-ptr casting correctly. r? lcnr Built on rust-lang#128694
…, r=lcnr Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver Realized that the new solver didn't handle ptr-to-ptr casting correctly. r? lcnr Built on rust-lang#128694
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#128712 (Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver) - rust-lang#128861 (Rework MIR inlining debuginfo so function parameters show up in debuggers.) - rust-lang#128912 (Store `do_not_recommend`-ness in impl header) - rust-lang#129000 (bootstrap: clear miri ui-test deps when miri sysroot gets rebuilt) - rust-lang#129013 (Remove unused script from run-make tests) - rust-lang#129017 (Replace `std::fmt:FormatterFn` with `std::fmt::from_fn`) Failed merges: - rust-lang#128935 (More work on `zstd` compression) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#128712 (Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver) - rust-lang#128912 (Store `do_not_recommend`-ness in impl header) - rust-lang#129000 (bootstrap: clear miri ui-test deps when miri sysroot gets rebuilt) - rust-lang#129013 (Remove unused script from run-make tests) - rust-lang#129017 (Replace `std::fmt:FormatterFn` with `std::fmt::from_fn`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128712 - compiler-errors:normalize-borrowck, r=lcnr Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver Realized that the new solver didn't handle ptr-to-ptr casting correctly. r? lcnr Built on rust-lang#128694
Realized that the new solver didn't handle ptr-to-ptr casting correctly.
r? lcnr
Built on #128694