fix: add cfg(feature = "self_update") to statics only used by that feature#7185
Merged
fix: add cfg(feature = "self_update") to statics only used by that feature#7185
Conversation
…ature MISE_SELF_UPDATE_AVAILABLE and MISE_SELF_UPDATE_DISABLED_PATH are only used in self_update.rs which is conditionally compiled with the self_update feature. Without this cfg attribute, these statics generate dead_code warnings when the feature is disabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds conditional compilation attributes to prevent dead_code warnings when the self_update feature is disabled. The MISE_SELF_UPDATE_AVAILABLE and MISE_SELF_UPDATE_DISABLED_PATH statics are only used by code in self_update.rs, which is conditionally compiled based on the self_update feature flag.
- Added
#[cfg(feature = "self_update")]attributes to two static variables that are only used when the self_update feature is enabled
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.0 x -- echo |
19.0 ± 0.3 | 18.5 | 21.2 | 1.00 |
mise x -- echo |
19.3 ± 0.4 | 18.7 | 23.0 | 1.02 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.0 env |
18.6 ± 0.4 | 18.1 | 23.2 | 1.00 |
mise env |
18.8 ± 0.4 | 18.2 | 23.0 | 1.01 ± 0.03 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.0 hook-env |
18.8 ± 0.3 | 18.1 | 20.1 | 1.00 |
mise hook-env |
18.9 ± 0.3 | 18.3 | 20.4 | 1.00 ± 0.02 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.0 ls |
16.0 ± 0.4 | 15.4 | 20.3 | 1.00 |
mise ls |
16.1 ± 0.3 | 15.5 | 19.0 | 1.01 ± 0.03 |
xtasks/test/perf
| Command | mise-2025.12.0 | mise | Variance |
|---|---|---|---|
| install (cached) | 107ms | 108ms | +0% |
| ls (cached) | 65ms | 65ms | +0% |
| bin-paths (cached) | 71ms | 72ms | -1% |
| task-ls (cached) | 423ms | 435ms | -2% |
jdx
pushed a commit
that referenced
this pull request
Dec 8, 2025
### 🚀 Features - **(npm)** support pnpm as a package manager for npm backend by @risu729 in [#7214](#7214) - **(tool-stubs)** add --bootstrap flag to mise generate tool-stub by @jdx in [#7203](#7203) ### 🐛 Bug Fixes - **(alpine)** increase alpine release timeout to 60 minutes by @jdx in [#7188](#7188) - **(bun)** use x64-baseline for aarch64 on Windows by @roele in [#7190](#7190) - **(tools)** allow using env vars in tools by @antonsergeyev in [#7205](#7205) - add cfg(feature = "self_update") to statics only used by that feature by @jdx in [#7185](#7185) ### 📚 Documentation - Update registry.md by @jdx in [ad11ad1](ad11ad1) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to 2909cce by @renovate[bot] in [#7196](#7196) - update fedora:43 docker digest to 6cd815d by @renovate[bot] in [#7195](#7195) - update ghcr.io/jdx/mise:deb docker digest to 1893530 by @renovate[bot] in [#7198](#7198) - update ghcr.io/jdx/mise:copr docker digest to 0447a85 by @renovate[bot] in [#7197](#7197) ### 📦 Registry - add Supabase CLI to registry.toml by @bodadotsh in [#7206](#7206) - add cmake aqua backend by @mangkoran in [#7186](#7186) ### New Contributors - @antonsergeyev made their first contribution in [#7205](#7205) - @bodadotsh made their first contribution in [#7206](#7206) ## 📦 Aqua Registry Updates #### New Packages (3) - [`skanehira/ghost`](https://github.com/skanehira/ghost) - [`square/certigo`](https://github.com/square/certigo) - [`steveyegge/beads`](https://github.com/steveyegge/beads) #### Updated Packages (8) - [`apache/maven`](https://github.com/apache/maven) - [`apple/container`](https://github.com/apple/container) - [`aquasecurity/trivy`](https://github.com/aquasecurity/trivy) - [`charmbracelet/crush`](https://github.com/charmbracelet/crush) - [`goreleaser/goreleaser`](https://github.com/goreleaser/goreleaser) - [`goreleaser/nfpm`](https://github.com/goreleaser/nfpm) - [`ninja-build/ninja`](https://github.com/ninja-build/ninja) - [`twpayne/chezmoi`](https://github.com/twpayne/chezmoi)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#[cfg(feature = "self_update")]toMISE_SELF_UPDATE_AVAILABLEandMISE_SELF_UPDATE_DISABLED_PATHstatics inenv.rsself_update.rs, which is conditionally compiled when theself_updatefeature is enabledTest plan
cargo buildcompiles without warnings🤖 Generated with Claude Code
Note
Gate
MISE_SELF_UPDATE_AVAILABLEandMISE_SELF_UPDATE_DISABLED_PATHbehindcfg(feature = "self_update")insrc/env.rs.Written by Cursor Bugbot for commit ce62cdc. This will update automatically on new commits. Configure here.