rust-lang / rust-lang/rfcs

Allow renaming RUST_BACKTRACE to MYCRATE_BACKTRACE

Open
#2,599 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-attributes A-debugging A-env T-compiler T-lang
Dominant language
Markdown
Stars
6.6k
Forks
1.7k
Avg merge
16h 14m
Merged PRs (30d)
1

Description

It would be nice if we could rename the RUST_BACKTRACE environment variable to something custom like MYCRATE_BACKTRACE. This idea came to me from looking at env_logger and how you can rename the environment variable it uses via from_env.

I suggest something along the lines of this:

#![backtrace_env = "MYCRATE_BACKTRACE"]

fn main() {
    // ...
}

And then enabling it via:

MYCRATE_BACKTRACE=1 ./mycrate

Supporting reasons:

  • Gives some sense of consistency for end users who may not know what Rust is, where the current variable name may be confusing
  • Some authors believe the end user has no business knowing what language their program was written in
  • Backtraces may be enabled for some Rust programs but not all when executed in the same environment, such as in a shell script

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the RFC process and the existing discussion on issue #2599. A complete contribution would specify the proposed attribute, its environment-variable behavior, and acceptance criteria clearly enough for an RFC decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.