Skip to content

Commit 2f1547c

Browse files
committedSep 11, 2018
Auto merge of #53873 - nikomatsakis:nll-universe-subtyping-and-pattern-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
2 parents f17c230 + f95f23f commit 2f1547c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1873
-1008
lines changed
 

‎src/librustc/ich/impls_mir.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ impl_stable_hash_for!(enum mir::LocalKind { Var, Temp, Arg, ReturnPointer });
2424
impl_stable_hash_for!(struct mir::LocalDecl<'tcx> {
2525
mutability,
2626
ty,
27+
user_ty,
2728
name,
2829
source_info,
2930
visibility_scope,
@@ -255,9 +256,10 @@ for mir::StatementKind<'gcx> {
255256
op.hash_stable(hcx, hasher);
256257
places.hash_stable(hcx, hasher);
257258
}
258-
mir::StatementKind::UserAssertTy(ref c_ty, ref local) => {
259+
mir::StatementKind::AscribeUserType(ref place, ref variance, ref c_ty) => {
260+
place.hash_stable(hcx, hasher);
261+
variance.hash_stable(hcx, hasher);
259262
c_ty.hash_stable(hcx, hasher);
260-
local.hash_stable(hcx, hasher);
261263
}
262264
mir::StatementKind::Nop => {}
263265
mir::StatementKind::InlineAsm { ref asm, ref outputs, ref inputs } => {

0 commit comments

Comments
 (0)