Skip to content

Commit 4867ce4

Browse files
authored
Rollup merge of rust-lang#65643 - varkor:remove-free-regions-from-const-placeholder, r=eddyb
Correct handling of type flags with `ConstValue::Placeholder` This fixes a mistake, but not rust-lang#65623. r? @eddyb
2 parents 84cb9af + 6661db0 commit 4867ce4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/librustc/ty/flags.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ impl FlagComputation {
114114
}
115115

116116
&ty::Placeholder(..) => {
117+
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES);
117118
self.add_flags(TypeFlags::HAS_TY_PLACEHOLDER);
118119
}
119120

@@ -123,8 +124,7 @@ impl FlagComputation {
123124
match infer {
124125
ty::FreshTy(_) |
125126
ty::FreshIntTy(_) |
126-
ty::FreshFloatTy(_) => {
127-
}
127+
ty::FreshFloatTy(_) => {}
128128

129129
ty::TyVar(_) |
130130
ty::IntVar(_) |
@@ -245,14 +245,16 @@ impl FlagComputation {
245245
}
246246
ConstValue::Bound(debruijn, _) => self.add_binder(debruijn),
247247
ConstValue::Param(_) => {
248-
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES | TypeFlags::HAS_PARAMS);
248+
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES);
249+
self.add_flags(TypeFlags::HAS_PARAMS);
249250
}
250251
ConstValue::Placeholder(_) => {
251-
self.add_flags(TypeFlags::HAS_FREE_REGIONS | TypeFlags::HAS_CT_PLACEHOLDER);
252+
self.add_flags(TypeFlags::HAS_FREE_LOCAL_NAMES);
253+
self.add_flags(TypeFlags::HAS_CT_PLACEHOLDER);
252254
}
253-
ConstValue::Scalar(_) => { }
254-
ConstValue::Slice { data: _, start: _, end: _ } => { }
255-
ConstValue::ByRef { alloc: _, offset: _ } => { }
255+
ConstValue::Scalar(_) => {}
256+
ConstValue::Slice { .. } => {}
257+
ConstValue::ByRef { .. } => {}
256258
}
257259
}
258260

0 commit comments

Comments
 (0)