-
Notifications
You must be signed in to change notification settings - Fork 13.3k
resolve typerelative ctors to adt #113217
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
resolve typerelative ctors to adt #113217
Conversation
This could use a MIR or THIR test ( |
I assume the THIR test should go in EDIT: added a thir-print test but am still wondering about the above |
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.
MIR tests go into tests/mir-opt/building
, with specific support for dumping MIR.
OTOH, I'm not convinced by the need to test the THIR dump.
@@ -351,19 +351,34 @@ impl<'tcx> Cx<'tcx> { | |||
}); | |||
} | |||
} | |||
let adt_data = | |||
if let hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) = fun.kind { | |||
let adt_data = if let hir::ExprKind::Path(qpath) = fun.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.
let adt_data = if let hir::ExprKind::Path(qpath) = fun.kind { | |
let adt_data = if let hir::ExprKind::Path(qpath) = fun.kind | |
&& let Some(adt_def) = expr_ty.ty_adt_def() | |
{ |
To avoid having to do it in all branches.
As per my comment above, I'm a bit sad about the THIR dump verbosity. However, isn't THIR the more logical place to test this, given that the bug was with HIR -> THIR lowering? |
@rustbot ready I've added both THIR and MIR tests for now: as I noted before I think the THIR test is a little verbose, but I don't think the mir dump test really shows much. When I ran the test again using the stage0 compiler (just as an easy-to-reach pre-my-changes compiler build) the only difference in the MIR dump seemed to be the presence of comments in the |
@bors r+ |
…-ctor-to-adt, r=cjgillot resolve typerelative ctors to adt Associated issue: rust-lang#110508 r? `@spastorino`
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#113005 (Don't call `query_normalize` when reporting similar impls) - rust-lang#113064 (std: edit [T]::swap docs) - rust-lang#113138 (Add release notes for 1.71.0) - rust-lang#113217 (resolve typerelative ctors to adt) - rust-lang#113254 (Use consistent formatting in Readme) - rust-lang#113482 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
Associated issue: #110508
r? @spastorino