Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the build for NLL #21356

Merged
merged 2 commits into from Aug 24, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Fix the build for NLL

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 24, 2018
commit 1333b6ee4513926fa192d438d16771922ce047a9

Some generated files are not rendered by default. Learn more.

@@ -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);

This comment has been minimized.

Copy link
@emilio

emilio Aug 7, 2018

Member

This looks a bit like a regression doesn't it?

This comment has been minimized.

Copy link
@KiChjang

KiChjang Aug 8, 2018

Member

This is possibly rust-lang/rust#47349, which I'm working on.

This comment has been minimized.

Copy link
@SimonSapin

SimonSapin Aug 8, 2018

Author Member

Per rust-lang/rust#47349 (comment) the new borrowck behavior is considered correct. That issue is only still open in order to improve the error message.

remaining_inline_size.scale_by(inline_size as f32 / total_minimum_size);
}
}
}
@@ -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 {

This comment has been minimized.

Copy link
@emilio

emilio Aug 7, 2018

Member

Just curious, are these just to avoid warnings?

This comment has been minimized.

Copy link
@SimonSapin

SimonSapin Aug 8, 2018

Author Member

Yes, I suppose that they were false negatives for the warning under AST-borrowck.

style.build_display_list(state)
}
}
@@ -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()
@@ -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()
@@ -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;
@@ -1907,7 +1907,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)?,
};

@@ -1944,8 +1944,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);
@@ -1153,7 +1153,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);
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.