mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Temporarily convert existing cfg(debug_assertions) crashes to warnings (#30578)
This commit is contained in:
parent
351b5036bf
commit
66258bfbbd
9 changed files with 53 additions and 16 deletions
|
@ -570,6 +570,22 @@ impl<T: Add<T, Output = T>> Add for LogicalSize<T> {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(servo#30577) remove this once underlying bugs are fixed
|
||||
impl<T: Add<T, Output = T>> LogicalSize<T> {
|
||||
#[inline]
|
||||
pub fn add_or_warn(self, other: LogicalSize<T>) -> LogicalSize<T> {
|
||||
#[cfg(debug_assertions)]
|
||||
if !(self.debug_writing_mode.mode == other.debug_writing_mode.mode) {
|
||||
log::warn!("debug assertion failed! self.debug_writing_mode.mode == other.debug_writing_mode.mode");
|
||||
}
|
||||
LogicalSize {
|
||||
debug_writing_mode: self.debug_writing_mode,
|
||||
inline: self.inline + other.inline,
|
||||
block: self.block + other.block,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Sub<T, Output = T>> Sub for LogicalSize<T> {
|
||||
type Output = LogicalSize<T>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue