Skip to content
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

Merged
merged 9 commits into from
Nov 23, 2017

Conversation

nikomatsakis
Copy link
Contributor

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

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 17, 2017
@@ -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
Copy link
Contributor

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?

@nikomatsakis
Copy link
Contributor Author

@arielb1 see latest commit. Tests seem to pass still.

@arielb1
Copy link
Contributor

arielb1 commented Nov 20, 2017

r=me with adt constructors being normalized in rustc_mir::shim instead of in type_check

@arielb1
Copy link
Contributor

arielb1 commented Nov 20, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Nov 20, 2017

📌 Commit a59147c has been approved by arielb1

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 21, 2017
@nikomatsakis
Copy link
Contributor Author

@bors r=arielb1

(rebased)

@bors
Copy link
Contributor

bors commented Nov 22, 2017

📌 Commit c52e51d has been approved by arielb1

@bors
Copy link
Contributor

bors commented Nov 23, 2017

⌛ Testing commit c52e51d with merge b9b82fd...

bors added a commit that referenced this pull request Nov 23, 2017
…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
@bors
Copy link
Contributor

bors commented Nov 23, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: arielb1
Pushing b9b82fd to master...

@bors bors merged commit c52e51d into rust-lang:master Nov 23, 2017
@nikomatsakis nikomatsakis deleted the nll-master-to-rust-master-1 branch December 5, 2017 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants