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

Possible Broken Dependency: linked_list_allocator #28

Closed
avlec opened this issue Mar 14, 2020 · 0 comments
Closed

Possible Broken Dependency: linked_list_allocator #28

avlec opened this issue Mar 14, 2020 · 0 comments

Comments

@avlec
Copy link
Contributor

avlec commented Mar 14, 2020

Trying to build on OSx 10.15.3. With the following Rust & Cargo versions.

master* ❯ rustc --version                                                                                                                                                                                                12:12:47
rustc 1.43.0-nightly (c20d7eecb 2020-03-11)
master* ❯ cargo --version                                                                                                                                                                                                12:17:34
cargo 1.43.0-nightly (bda50510d 2020-03-02)

The following error occurs when trying to envoke cargo build.

error[E0053]: method `alloc` has an incompatible type for trait
   --> /Users/avlec/.cargo/registry/src/github.com-1ecc6299db9ec823/linked_list_allocator-0.6.6/src/lib.rs:133:5
    |
133 |     unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
    |
    = note: expected fn pointer `fn(&mut Heap, core::alloc::Layout) -> core::result::Result<(core::ptr::NonNull<u8>, usize), _>`
               found fn pointer `unsafe fn(&mut Heap, core::alloc::Layout) -> core::result::Result<core::ptr::NonNull<u8>, _>`

This is verified an issue with the version of linked_list_allocator, as building with the same environment on 0.6.6 yields the same error. It is to note that this error is from just building linked_list_allocator independently from alloc-cortex-m.

~/Downloads/linked-list-allocator-0b7fdddd067448327a3f6ad9d2b39045a2b3f922 ❯ cargo build                                                                                                                                             13:51:13
    Updating crates.io index
  Downloaded spin v0.5.2
   Compiling spin v0.5.2
   Compiling linked_list_allocator v0.6.6 (/Users/avlec/Downloads/linked-list-allocator-0b7fdddd067448327a3f6ad9d2b39045a2b3f922)
error[E0053]: method `alloc` has an incompatible type for trait
   --> src/lib.rs:133:5
    |
133 |     unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
    |
    = note: expected fn pointer `fn(&mut Heap, core::alloc::Layout) -> core::result::Result<(core::ptr::NonNull<u8>, usize), _>`
               found fn pointer `unsafe fn(&mut Heap, core::alloc::Layout) -> core::result::Result<core::ptr::NonNull<u8>, _>`

Proposed solution is to update the linked_list_allocator dependency to 0.8.0 minimum, as this is the most recent version that successfully builds.

bors bot added a commit that referenced this issue Mar 14, 2020
29: Bumped dependency linked-list-allocator, fixed feature warn. r=jonas-schievink a=avlec

Fix regarding [this issue](#28 (comment)).

Co-authored-by: Alec Cox <avlecxk@gmail.com>
@avlec avlec closed this as completed Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant