Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0b1669d

Browse files
committedJan 25, 2019
Auto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelix
[NLL] Clean up handling of type annotations * Renames (Canonical)?UserTypeAnnotation -> (Canonical)?UserType so that the name CanonicalUserTypeAnnotation is free. * Keep the inferred type associated to user type annotations in the MIR, so that it can be compared against the annotated type, even when the annotated expression gets removed from the MIR. (#54943) * Use the inferred type to allow infallible handling of user type projections (#57531) * Uses revisions for the tests in #56993 * Check the types of `Unevaluated` constants with no annotations (#46702) * Some drive-by cleanup Closes #46702 Closes #54943 Closes #57531 Closes #57731 cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment r? @nikomatsakis
2 parents 7187db6 + 620a03f commit 0b1669d

File tree

49 files changed

+849
-291
lines changed

Some content is hidden

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

49 files changed

+849
-291
lines changed
 

‎src/librustc/ich/impls_ty.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,16 +1240,22 @@ impl_stable_hash_for!(
12401240
}
12411241
);
12421242

1243-
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for ty::UserTypeAnnotation<'gcx> {
1243+
impl_stable_hash_for!(
1244+
struct ty::CanonicalUserTypeAnnotation<'tcx> {
1245+
user_ty, span, inferred_ty
1246+
}
1247+
);
1248+
1249+
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for ty::UserType<'gcx> {
12441250
fn hash_stable<W: StableHasherResult>(&self,
12451251
hcx: &mut StableHashingContext<'a>,
12461252
hasher: &mut StableHasher<W>) {
12471253
mem::discriminant(self).hash_stable(hcx, hasher);
12481254
match *self {
1249-
ty::UserTypeAnnotation::Ty(ref ty) => {
1255+
ty::UserType::Ty(ref ty) => {
12501256
ty.hash_stable(hcx, hasher);
12511257
}
1252-
ty::UserTypeAnnotation::TypeOf(ref def_id, ref substs) => {
1258+
ty::UserType::TypeOf(ref def_id, ref substs) => {
12531259
def_id.hash_stable(hcx, hasher);
12541260
substs.hash_stable(hcx, hasher);
12551261
}

‎src/librustc/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use ty::subst::{Subst, Substs};
3131
use ty::layout::VariantIdx;
3232
use ty::{
3333
self, AdtDef, CanonicalUserTypeAnnotations, ClosureSubsts, GeneratorSubsts, Region, Ty, TyCtxt,
34-
UserTypeAnnotationIndex, UserTypeAnnotation,
34+
UserTypeAnnotationIndex,
3535
};
3636
use util::ppaux;
3737

0 commit comments

Comments
 (0)
Please sign in to comment.