-
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
typeck aggregate rvalues in MIR type checker #46054
typeck aggregate rvalues in MIR type checker #46054
Conversation
@@ -408,6 +411,11 @@ pub struct TypeChecker<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { | |||
body_id: ast::NodeId, | |||
reported_errors: FxHashSet<(Ty<'tcx>, Span)>, | |||
constraints: MirTypeckRegionConstraints<'tcx>, | |||
|
|||
// FIXME(#45940) - True if this is a MIR shim or ADT constructor |
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.
Isn't it a better idea to instead normalize field types in ADT constructors?
@arielb1 see latest commit. Tests seem to pass still. |
r=me with adt constructors being normalized in rustc_mir::shim instead of in type_check |
@bors r+ |
📌 Commit a59147c has been approved by |
a59147c
to
c52e51d
Compare
@bors r=arielb1 (rebased) |
📌 Commit c52e51d has been approved by |
…ielb1 typeck aggregate rvalues in MIR type checker This branch is an attempt to land content by @spastorino and @Nashenas88 that was initially landed on nll-master while we waited for #45825 to land. The biggest change it contains is that it extends the MIR type-checker to also type-check MIR aggregate rvalues (at least partially). Specifically, it checks that the operands provided for each field have the right type. It does not yet check that their well-formedness predicates are met. That is #45827. It also does not check other kinds of rvalues (that is #45959). @spastorino is working on those issues now. r? @arielb1
☀️ Test successful - status-appveyor, status-travis |
This branch is an attempt to land content by @spastorino and @Nashenas88 that was initially landed on nll-master while we waited for #45825 to land.
The biggest change it contains is that it extends the MIR type-checker to also type-check MIR aggregate rvalues (at least partially). Specifically, it checks that the operands provided for each field have the right type.
It does not yet check that their well-formedness predicates are met. That is #45827. It also does not check other kinds of rvalues (that is #45959). @spastorino is working on those issues now.
r? @arielb1