Skip to content

Commit

Permalink
Fix the build for NLL
Browse files Browse the repository at this point in the history
Test with `RUSTFLAGS="-Zborrowck=mir -Ztwo-phase-borrows" cargo build`

https://internals.rust-lang.org/t/help-us-get-non-lexical-lifetimes-nll-over-the-finish-line/7807/7
  • Loading branch information
SimonSapin committed Aug 7, 2018
1 parent 5410505 commit d1733aa
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions components/layout/table.rs
Expand Up @@ -448,9 +448,9 @@ impl Flow for TableFlow {
.sum::<f32>();

for &index in &constrained_column_inline_sizes_indices {
let inline_size = self.column_computed_inline_sizes[index].size.0;
self.column_computed_inline_sizes[index].size +=
remaining_inline_size.scale_by(
self.column_computed_inline_sizes[index].size.0 as f32 / total_minimum_size);
remaining_inline_size.scale_by(inline_size as f32 / total_minimum_size);
}
}
}
Expand Down Expand Up @@ -531,7 +531,7 @@ impl Flow for TableFlow {
self.block_flow.build_display_list_for_block(state, border_painting_mode);

let iter = TableCellStyleIterator::new(&self);
for mut style in iter {
for style in iter {
style.build_display_list(state)
}
}
Expand Down Expand Up @@ -964,7 +964,7 @@ impl<'a> Iterator for TableRowAndGroupIterator<'a> {
match self.kids.next() {
Some(kid) => {
if kid.is_table_rowgroup() {
let mut rowgroup = kid.as_table_rowgroup();
let rowgroup = kid.as_table_rowgroup();
let iter = rowgroup.block_flow.base.child_iter();
self.group = Some((&rowgroup.block_flow.fragment, iter));
self.next()
Expand Down Expand Up @@ -1010,7 +1010,7 @@ impl<'a> Iterator for MutTableRowAndGroupIterator<'a> {
match self.kids.next() {
Some(kid) => {
if kid.is_table_rowgroup() {
let mut rowgroup = kid.as_mut_table_rowgroup();
let rowgroup = kid.as_mut_table_rowgroup();
let iter = rowgroup.block_flow.base.child_iter_mut();
self.group = Some((&rowgroup.block_flow.fragment, iter));
self.next()
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/imagedata.rs
Expand Up @@ -65,7 +65,7 @@ impl ImageData {
if let Some(jsobject) = opt_jsobject {
let cx = global.get_cx();
typedarray!(in(cx) let array_res: Uint8ClampedArray = jsobject);
let mut array = array_res
let array = array_res
.map_err(|_| Error::Type("Argument to Image data is not an Uint8ClampedArray".to_owned()))?;

let byte_len = array.as_slice().len() as u32;
Expand Down
6 changes: 3 additions & 3 deletions components/script/dom/webglrenderingcontext.rs
Expand Up @@ -1979,7 +1979,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {

typedarray!(in(cx) let array_buffer: ArrayBuffer = data);
let data_vec = match array_buffer {
Ok(mut data) => data.to_vec(),
Ok(data) => data.to_vec(),
Err(_) => fallible_array_buffer_view_to_vec(cx, data)?,
};

Expand Down Expand Up @@ -2016,8 +2016,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
fn BufferSubData(&self, target: u32, offset: i64, data: ArrayBufferViewOrArrayBuffer) {
let data_vec = match data {
// Typed array is rooted, so we can safely temporarily retrieve its slice
ArrayBufferViewOrArrayBuffer::ArrayBuffer(mut inner) => inner.to_vec(),
ArrayBufferViewOrArrayBuffer::ArrayBufferView(mut inner) => inner.to_vec(),
ArrayBufferViewOrArrayBuffer::ArrayBuffer(inner) => inner.to_vec(),
ArrayBufferViewOrArrayBuffer::ArrayBufferView(inner) => inner.to_vec(),
};

let bound_buffer = handle_potential_webgl_error!(self, self.bound_buffer(target), return);
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/window.rs
Expand Up @@ -1117,7 +1117,7 @@ impl Window {
pub fn cancel_all_tasks(&self) {
let mut ignore_flags = self.ignore_further_async_events.borrow_mut();
for task_source_name in TaskSourceName::all() {
let mut flag = ignore_flags.entry(task_source_name).or_insert(Default::default());
let flag = ignore_flags.entry(task_source_name).or_insert(Default::default());
let cancelled = mem::replace(&mut *flag, Default::default());
cancelled.store(true, Ordering::Relaxed);
}
Expand Down

0 comments on commit d1733aa

Please sign in to comment.