Skip to content

Commit

Permalink
Use modern syntax for optional dependencies (#1229)
Browse files Browse the repository at this point in the history
Use the "dep:" prefix to specify optional dependencies in Cargo
features.

An optional crate dependency implicitly generates a feature of the same
name, and can be leaked to the user of the current crate. But if a
feature specifies a crate dependency with the "dep:" prefix, it will not
implicitly generate the feature, hiding it from the users. The "dep:"
prefix was introduced in Rust 1.60.
  • Loading branch information
wks authored Nov 6, 2024
1 parent 3575521 commit 59ea62e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ builtin_env_logger = ["dep:env_logger"]

# This feature is only supported on x86-64 for now
# It's manually added to CI scripts
perf_counter = ["pfm"]
perf_counter = ["dep:pfm"]

# This feature is only used for tests with MockVM.
# CI scripts run those tests with this feature.
Expand Down Expand Up @@ -184,8 +184,8 @@ bpftrace_workaround = []
# Group:malloc
# only one of the following features should be enabled, or none to use the default malloc from libc
# this does not replace the global Rust allocator, but provides these libraries for GC implementation
malloc_mimalloc = ["mimalloc-sys"]
malloc_jemalloc = ["jemalloc-sys"]
malloc_mimalloc = ["dep:mimalloc-sys"]
malloc_jemalloc = ["dep:jemalloc-sys"]

# Use the native mimalloc allocator for malloc. This is not tested by me (Yi) yet, and it is only used to make sure that some code
# is not compiled in default builds.
Expand Down

0 comments on commit 59ea62e

Please sign in to comment.