Skip to content

Commit

Permalink
Auto merge of #53873 - nikomatsakis:nll-universe-subtyping-and-patter…
Browse files Browse the repository at this point in the history
…n-ascription, r=pnkfelix

support ascription for patterns in NLL

This implements the strategy outlined in [this comment](#47184 (comment)):

- We first extend the NLL subtyping code so it can handle inference variables and subtyping.
- Then we extend HAIR patterns with type ascription.
- Then we treat the type `T` in `let pat: T = ...` as an ascription.

Before landing, a few things:

- [x] Fix the WF rule bug (filed a FIXME #54105)
- [x] Fix an ICE I encountered locally around bound regions, or else file a follow-up
- [x] More tests probably =)

r? @pnkfelix
  • Loading branch information
bors committed Sep 11, 2018
2 parents f17c230 + f95f23f commit 2f1547c
Show file tree
Hide file tree
Showing 55 changed files with 1,873 additions and 1,008 deletions.
6 changes: 4 additions & 2 deletions src/librustc/ich/impls_mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl_stable_hash_for!(enum mir::LocalKind { Var, Temp, Arg, ReturnPointer });
impl_stable_hash_for!(struct mir::LocalDecl<'tcx> {
mutability,
ty,
user_ty,
name,
source_info,
visibility_scope,
Expand Down Expand Up @@ -255,9 +256,10 @@ for mir::StatementKind<'gcx> {
op.hash_stable(hcx, hasher);
places.hash_stable(hcx, hasher);
}
mir::StatementKind::UserAssertTy(ref c_ty, ref local) => {
mir::StatementKind::AscribeUserType(ref place, ref variance, ref c_ty) => {
place.hash_stable(hcx, hasher);
variance.hash_stable(hcx, hasher);
c_ty.hash_stable(hcx, hasher);
local.hash_stable(hcx, hasher);
}
mir::StatementKind::Nop => {}
mir::StatementKind::InlineAsm { ref asm, ref outputs, ref inputs } => {
Expand Down
Loading

0 comments on commit 2f1547c

Please sign in to comment.