-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
No global memory allocator error when testing no_std crate that does link to std #54010
Comments
I have the same issue. Any update? |
|
I have the same issue, error message seems to be spurious |
Yeah, the error message is emitted when building the Sadly, there is currently no way to link in a default allocator (or I simply use |
Related: #52243 |
Don't use std crate at all Fixes #95 We're running into rust-lang/rust#54010 but I don't think it's a problem.
@rustbot modify labels: +T-rustdoc |
Error: Parsing label command in comment failed: ...ify labels|error: must have : or to as label starter at >| +T-rustdo... Please let |
With 1.36.0, alloc crate is now stable, so we always use no_std for capstone-rs. There is no longer a "std" feature. Remove alloc_system feature, since the default allocator is the system allocator. Minor bug: doc-tests fail See: rust-lang/rust#54010
With 1.36.0, alloc crate is now stable, so we always use no_std for capstone-rs. There is no longer a "std" feature. Remove alloc_system feature, since the default allocator is the system allocator. Update CI tests to not use features. Minor bug: doc-tests fail See: rust-lang/rust#54010
With 1.36.0, alloc crate is now stable, so we always use no_std for capstone-rs. There is no longer a "std" feature. Remove alloc_system feature, since the default allocator is the system allocator. Update CI tests to not use features. Minor bug: doc-tests fail See: rust-lang/rust#54010
Having them activated causes this message: error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait. The tests still succeed, but it's annoying. Therefore disabled until we have any doctests. rust-lang/rust#54010
If you don't put |
Also see #52243 (comment): the error is basically spurious. |
This crate only needs `core` and `alloc`, so we can mark it as `#![no_std]`. In theory, more people can use this crate now. Currently, running `cargo test --doc` still prints an error that doesn't make any sense, but this is not a problem. It's a known bug: rust-lang/rust#54010
Having them activated causes this message: error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait. The tests still succeed, but it's annoying. Therefore disabled until we have any doctests. rust-lang/rust#54010
Because of rust-lang/rust#54010, `cargo test` currently gives a spurious, harmless error in all but a very recent nightly.
Because of rust-lang/rust#54010, `cargo test` currently gives a spurious, harmless error in all but a very recent nightly.
On stable rust, actually running the tests for this crate succeeds but yells about there no being a global memory allocator. This is an error that'll eventually be fixed (rust-lang/rust#54010); for now running without the no_std feature is a workaround.
I have a no_std crate that imports std when testing:
However, I get this error during testing:
Allocating on the heap during testing does appear to work, so I'm assuming this is just a case of the warning still being emitted.
The text was updated successfully, but these errors were encountered: