mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #19970 - janczer:change_debug_assertions, r=emilio
Change debug assertions to specific ones <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #19962 (github issue number if applicable). <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19970) <!-- Reviewable:end -->
This commit is contained in:
commit
5d209a70ab
23 changed files with 53 additions and 53 deletions
|
@ -485,7 +485,7 @@ pub enum MarginsMayCollapseFlag {
|
|||
MarginsMayNotCollapse,
|
||||
}
|
||||
|
||||
#[derive(PartialEq)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum FormattingContextType {
|
||||
None,
|
||||
Block,
|
||||
|
@ -1472,7 +1472,7 @@ impl BlockFlow {
|
|||
fn assign_inline_position_for_formatting_context(&mut self,
|
||||
layout_context: &LayoutContext,
|
||||
content_box: LogicalRect<Au>) {
|
||||
debug_assert!(self.formatting_context_type() != FormattingContextType::None);
|
||||
debug_assert_ne!(self.formatting_context_type(), FormattingContextType::None);
|
||||
|
||||
if !self.base.restyle_damage.intersects(ServoRestyleDamage::REFLOW_OUT_OF_FLOW | ServoRestyleDamage::REFLOW) {
|
||||
return
|
||||
|
|
|
@ -269,7 +269,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
},
|
||||
DisplayItem::PushStackingContext(ref item) => {
|
||||
let stacking_context = &item.stacking_context;
|
||||
debug_assert!(stacking_context.context_type == StackingContextType::Real);
|
||||
debug_assert_eq!(stacking_context.context_type, StackingContextType::Real);
|
||||
|
||||
let transform = stacking_context
|
||||
.transform
|
||||
|
|
|
@ -767,7 +767,7 @@ impl Fragment {
|
|||
let ellipsis_fragments = with_thread_local_font_context(layout_context, |font_context| {
|
||||
TextRunScanner::new().scan_for_runs(font_context, unscanned_ellipsis_fragments)
|
||||
});
|
||||
debug_assert!(ellipsis_fragments.len() == 1);
|
||||
debug_assert_eq!(ellipsis_fragments.len(), 1);
|
||||
ellipsis_fragment = ellipsis_fragments.fragments.into_iter().next().unwrap();
|
||||
ellipsis_fragment.flags |= FragmentFlags::IS_ELLIPSIS;
|
||||
ellipsis_fragment
|
||||
|
|
|
@ -804,7 +804,7 @@ impl LineBreaker {
|
|||
self.work_list.push_front(cur_fragment);
|
||||
for fragment_index in (last_known_line_breaking_opportunity.get()..
|
||||
self.pending_line.range.end().get()).rev() {
|
||||
debug_assert!(fragment_index == (self.new_fragments.len() as isize) - 1);
|
||||
debug_assert_eq!(fragment_index, (self.new_fragments.len() as isize) - 1);
|
||||
self.work_list.push_front(self.new_fragments.pop().unwrap());
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ impl TableFlow {
|
|||
}
|
||||
} else {
|
||||
// We discovered a new column. Initialize its data.
|
||||
debug_assert!(column_index == parent_inline_sizes.len());
|
||||
debug_assert_eq!(column_index, parent_inline_sizes.len());
|
||||
if child_cell_inline_size.column_span > 1 {
|
||||
// TODO(pcwalton): Perform the recursive algorithm specified in INTRINSIC §
|
||||
// 4. For now we make this column contribute no width.
|
||||
|
@ -635,7 +635,7 @@ impl<T> VecExt<T> for Vec<T> {
|
|||
if index < self.len() {
|
||||
self[index] = value
|
||||
} else {
|
||||
debug_assert!(index == self.len());
|
||||
debug_assert_eq!(index, self.len());
|
||||
self.push(value)
|
||||
}
|
||||
&mut self[index]
|
||||
|
@ -643,7 +643,7 @@ impl<T> VecExt<T> for Vec<T> {
|
|||
|
||||
fn get_mut_or_push(&mut self, index: usize, zero: T) -> &mut T {
|
||||
if index >= self.len() {
|
||||
debug_assert!(index == self.len());
|
||||
debug_assert_eq!(index, self.len());
|
||||
self.push(zero)
|
||||
}
|
||||
&mut self[index]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue