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

Build fails: error[E0433]: failed to resolve: use of undeclared crate or module alloc #1745

Open
yurivict opened this issue Mar 29, 2024 · 2 comments

Comments

@yurivict
Copy link

Describe the bug

     Running `CARGO=/usr/local/bin/cargo CARGO_CFG_PANIC=unwind CARGO_CFG_TARGET_ARCH=x86_64 CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV='' CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2 CARGO_CFG_TARGET_HAS_ATOMIC=16,32,64,8,ptr CARGO_CFG_TARGET_OS=freebsd CARGO_CFG_TARGET_POINTER_WIDTH=64 CARGO_CFG_TARGET_VENDOR=unknown CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='-Clink-arg=-fstack-protector-strong' CARGO_FEATURE_DEFAULT=1 CARGO_FEATURE_STD=1 CARGO_MANIFEST_DIR=/wrkdirs/usr/ports/devel/tabby/work/tabby-0.9.1/cargo-crates/smartstring-1.0.1 CARGO_PKG_AUTHORS='Bodil Stokke <bodil@bodil.org>' CARGO_PKG_DESCRIPTION='Compact inlined strings' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MPL-2.0+ CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=smartstring CARGO_PKG_README=./README.md CARGO_PKG_REPOSITORY='https://github.com/bodil/smartstring' CARGO_PKG_RUST_VERSION=1.57 CARGO_PKG_VERSION=1.0.1 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=1 CARGO_PKG_VERSION_PRE='' DEBUG=false HOST=x86_64-unknown-freebsd LD_LIBRARY_PATH='/wrkdirs/usr/ports/devel/tabby/work/target/release/deps:/wrkdirs/usr/ports/devel/tabby/work/target/release:/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib' NUM_JOBS=6 OPT_LEVEL=2 OUT_DIR=/wrkdirs/usr/ports/devel/tabby/work/target/x86_64-unknown-freebsd/release/build/smartstring-198a2c88d2dc1965/out PROFILE=release RUSTC=/usr/local/bin/rustc RUSTC_LINKER=cc RUSTDOC=/usr/local/bin/rustdoc TARGET=x86_64-unknown-freebsd /wrkdirs/usr/ports/devel/tabby/work/target/release/build/smartstring-75fb01878bd660fb/build-script-build`
[smartstring 1.0.1] error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
[smartstring 1.0.1]  --> <anon>:1:18
[smartstring 1.0.1]   |
[smartstring 1.0.1] 1 | pub trait Probe: alloc::alloc::Allocator + Sized {}
[smartstring 1.0.1]   |                  ^^^^^ use of undeclared crate or module `alloc`
[smartstring 1.0.1]   |
[smartstring 1.0.1]   = help: add `extern crate alloc` to use the `alloc` crate
[smartstring 1.0.1] help: consider importing this module
[smartstring 1.0.1]   |
[smartstring 1.0.1] 1 + use std::alloc;
[smartstring 1.0.1]   |
[smartstring 1.0.1] help: if you import `alloc`, refer to it directly
[smartstring 1.0.1]   |
[smartstring 1.0.1] 1 - pub trait Probe: alloc::alloc::Allocator + Sized {}
[smartstring 1.0.1] 1 + pub trait Probe: alloc::Allocator + Sized {}
[smartstring 1.0.1]   |                  
[smartstring 1.0.1]   
[smartstring 1.0.1] error: aborting due to 1 previous error
[smartstring 1.0.1] 

Information about your version

tabby-0.9.1
rust-1.76.0

@wsxiaoys
Copy link
Member

Hey - could you share the commit hash you used to run cargo build?

@yurivict
Copy link
Author

It uses the v0.9.1 tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants