Skip to content

Fix for Rust changes #79

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

Merged
merged 2 commits into from
Jul 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ rust:
- nightly

before_script:
- (cargo install mdbook --force || true)
- (cargo install mdbook --force --vers "0.1.7" || true)

script:
- export PATH=$PATH:/home/travis/.cargo/bin;
4 changes: 2 additions & 2 deletions src/vec-final.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ use std::ptr::{Unique, NonNull, self};
use std::mem;
use std::ops::{Deref, DerefMut};
use std::marker::PhantomData;
use std::alloc::{Alloc, GlobalAlloc, Layout, Global, oom};
use std::alloc::{Alloc, GlobalAlloc, Layout, Global, handle_alloc_error};

struct RawVec<T> {
ptr: Unique<T>,
@@ -47,7 +47,7 @@ impl<T> RawVec<T> {

// If allocate or reallocate fail, oom
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR missed comment modification, see #77

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to submit a comment fix?

Copy link

@mati865 mati865 Jul 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit time-constrained for now, there may be other places to fix.

if ptr.is_err() {
oom(Layout::from_size_align_unchecked(
handle_alloc_error(Layout::from_size_align_unchecked(
new_cap * elem_size,
mem::align_of::<T>(),
))