Skip to content

Commit

Permalink
Rollup merge of rust-lang#65643 - varkor:remove-free-regions-from-con…
Browse files Browse the repository at this point in the history
…st-placeholder, r=eddyb

Correct handling of type flags with `ConstValue::Placeholder`

This fixes a mistake, but not rust-lang#65623.

r? @eddyb
  • Loading branch information
Centril authored Oct 28, 2019
2 parents 2fe6f22 + 6661db0 commit 216e50d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/librustc/ty/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ impl FlagComputation {
}

&ty::Placeholder(..) => {
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES);
self.add_flags(TypeFlags::HAS_TY_PLACEHOLDER);
}

Expand All @@ -123,8 +124,7 @@ impl FlagComputation {
match infer {
ty::FreshTy(_) |
ty::FreshIntTy(_) |
ty::FreshFloatTy(_) => {
}
ty::FreshFloatTy(_) => {}

ty::TyVar(_) |
ty::IntVar(_) |
Expand Down Expand Up @@ -245,14 +245,16 @@ impl FlagComputation {
}
ConstValue::Bound(debruijn, _) => self.add_binder(debruijn),
ConstValue::Param(_) => {
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES | TypeFlags::HAS_PARAMS);
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES);
self.add_flags(TypeFlags::HAS_PARAMS);
}
ConstValue::Placeholder(_) => {
self.add_flags(TypeFlags::HAS_FREE_REGIONS | TypeFlags::HAS_CT_PLACEHOLDER);
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES);
self.add_flags(TypeFlags::HAS_CT_PLACEHOLDER);
}
ConstValue::Scalar(_) => { }
ConstValue::Slice { data: _, start: _, end: _ } => { }
ConstValue::ByRef { alloc: _, offset: _ } => { }
ConstValue::Scalar(_) => {}
ConstValue::Slice { .. } => {}
ConstValue::ByRef { .. } => {}
}
}

Expand Down

0 comments on commit 216e50d

Please sign in to comment.