`trace!` code still present in the generated non-release binary.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.5k
- Forks
- 289
- Avg merge
- 55m
- Merged PRs (30d)
- 1
Description
When using max_level_debug feature, and compiling a non-release build, my expectation would be that trace! code is not present in the binary. As mentioned in the documentation:
Log levels can be statically disabled at compile time via Cargo features. Log invocations at disabled levels will be skipped and will not even be present in the resulting binary
However, the binary still contains some code which is not optimized away by the Rust compiler:
33a8bb: e8 70 bf ff ff callq 336830 <_ZN76_$LT$log..Level$u20$as$u20$core..cmp..PartialOrd$LT$log..LevelFilter$GT$$GT$2le17hd9204c8739150144E
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documentation claim about statically disabled log levels and the disassembly showing the Level comparison call. Trace the max_level_debug feature and trace! code paths to determine why this call remains in a non-release binary. Done means disabled trace code and the reported comparison are absent from the generated binary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100