Skip to content

Commit 609e621

Browse files
committed
Merge pull request #151 from marcusklaas/fix-for-servo
Fix underflow bug in rewrite_call
2 parents c10c732 + d13fc22 commit 609e621

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn rewrite_call(context: &RewriteContext,
132132
}
133133

134134
// 2 is for parens.
135-
let remaining_width = width - callee_str.len() - 2;
135+
let remaining_width = try_opt!(width.checked_sub(callee_str.len() + 2));
136136
let offset = callee_str.len() + 1 + offset;
137137

138138
let items = itemize_list(context.codemap,

tests/target/fn.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,17 @@ fn main() {
7979
let _ = function(move || 5);
8080
let _ = move || 42;
8181
}
82+
83+
fn servo() {
84+
let constellation_chan = Constellation::<layout::layout_task::LayoutTask,
85+
script::script_task::ScriptTask>::start(
86+
compositor_proxy,
87+
resource_task,
88+
image_cache_task,
89+
font_cache_task,
90+
time_profiler_chan,
91+
mem_profiler_chan,
92+
devtools_chan,
93+
storage_task,
94+
supports_clipboard);
95+
}

0 commit comments

Comments
 (0)