Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdate Rust and use the newly-stable std::ptr::NonNull #19829
Conversation
highfive
commented
Jan 22, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jan 22, 2018
|
Looks good to me, feel free to handle my remarks as a follow-up issue. Would be nice if you filed an issue about auditing all the |
| @@ -106,7 +106,7 @@ impl<T: DomObject + JSTraceable + Iterable> IterableIterator<T> { | |||
| self.index.set(index + 1); | |||
| result.map(|_| { | |||
| assert!(!rval.is_null()); | |||
| unsafe { NonNullJSObjectPtr::new_unchecked(rval.get()) } | |||
| unsafe { NonNull::new_unchecked(rval.get()) } | |||
This comment has been minimized.
This comment has been minimized.
| assert!(!self.data.get().is_null()); | ||
| NonNullJSObjectPtr::new_unchecked(self.data.get()) | ||
| NonNull::new_unchecked(self.data.get()) |
This comment has been minimized.
This comment has been minimized.
| rooted!(in(cx) let array = JS_NewUint8ClampedArray(cx, 16)); | ||
| assert!(!array.is_null()); | ||
| NonNullJSObjectPtr::new_unchecked(array.get()) | ||
| NonNull::new_unchecked(array.get()) |
This comment has been minimized.
This comment has been minimized.
| // Step 1 | ||
| let created = self.response_arraybuffer.get(); | ||
| if !created.is_null() { | ||
| return Some(NonNullJSObjectPtr::new_unchecked(created)); | ||
| return Some(NonNull::new_unchecked(created)); |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r+ |
|
|
Update Rust and use the newly-stable std::ptr::NonNull <!-- 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/19829) <!-- Reviewable:end -->
|
|
Compiling libservo v0.0.1 (file:///home/servo/buildbot/slave/linux-dev/build/components/servo)
Compiling glutin_app v0.0.1 (file:///home/servo/buildbot/slave/linux-dev/build/ports/glutin)
Compiling embedding v0.0.1 (file:///home/servo/buildbot/slave/linux-dev/build/ports/cef)
error: unnecessary parentheses around function argument
--> ports/cef/eutil.rs:33:34
|
33 | let object = libc::calloc(1, (mem::size_of::<Base>() + mem::size_of::<Extra>())) as
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
|
= note: `-D unused-parens` implied by `-D warnings`
error: unnecessary parentheses around function argument
--> ports/cef/wrappers.rs:202:36
|
202 | let ptr = libc::malloc(((buffer.len() + 1) * 2)) as *mut c_ushort;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
error: aborting due to 2 previous errors
error: Could not compile `embedding`. |
|
@bors-servo r=nox |
|
|
Update Rust and use the newly-stable std::ptr::NonNull <!-- 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/19829) <!-- Reviewable:end -->
Terrifying! |
|
|
SimonSapin commentedJan 22, 2018
•
edited
This change is