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 3cb24bd

Browse files
committedSep 12, 2017
Auto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakis
Evaluate fixed-length array length expressions lazily. This is in preparation for polymorphic array lengths (aka `[T; T::A]`) and const generics. We need deferred const-evaluation to break cycles when array types show up in positions which require knowing the array type to typeck the array length, e.g. the array type is in a `where` clause. The final step - actually passing bounds in scope to array length expressions from the parent - is not done because it still produces cycles when *normalizing* `ParamEnv`s, and @nikomatsakis' in-progress lazy normalization work is needed to deal with that uniformly. However, the changes here are still useful to unlock work on const generics, which @EpicatSupercell manifested interest in, and I might be mentoring them for that, but we need this baseline first. r? @nikomatsakis cc @oli-obk
2 parents 11f64d8 + 57ebd28 commit 3cb24bd

File tree

104 files changed

+1605
-785
lines changed

Some content is hidden

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

104 files changed

+1605
-785
lines changed
 

‎src/librustc/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ pub enum BindingAnnotation {
611611
RefMut,
612612
}
613613

614-
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
614+
#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
615615
pub enum RangeEnd {
616616
Included,
617617
Excluded,

‎src/librustc/ich/impls_mir.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,6 @@ impl<'a, 'gcx, 'tcx> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for mir::L
493493
hasher: &mut StableHasher<W>) {
494494
mem::discriminant(self).hash_stable(hcx, hasher);
495495
match *self {
496-
mir::Literal::Item { def_id, substs } => {
497-
def_id.hash_stable(hcx, hasher);
498-
substs.hash_stable(hcx, hasher);
499-
}
500496
mir::Literal::Value { ref value } => {
501497
value.hash_stable(hcx, hasher);
502498
}

0 commit comments

Comments
 (0)
Please sign in to comment.