diff options
| author | vsrs <vit@conrlab.com> | 2021-01-27 00:09:15 +0300 |
|---|---|---|
| committer | vsrs <vit@conrlab.com> | 2021-01-27 00:09:15 +0300 |
| commit | ad603c3867ab31e8f433794481bb657a26a45bc0 (patch) | |
| tree | c2f73e064217060b34d2781b8db93ee1ea2dc217 | |
| parent | 185cd736a6da34891a9a5c5e9a2457eb075e565b (diff) | |
| download | rust-ad603c3867ab31e8f433794481bb657a26a45bc0.tar.gz rust-ad603c3867ab31e8f433794481bb657a26a45bc0.zip | |
Add debug only guard for the --wait-dbg flag
| -rw-r--r-- | crates/rust-analyzer/src/bin/args.rs | 3 | ||||
| -rw-r--r-- | crates/rust-analyzer/src/bin/main.rs | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/bin/args.rs b/crates/rust-analyzer/src/bin/args.rs index c5f8140216a..100e46d2f1d 100644 --- a/crates/rust-analyzer/src/bin/args.rs +++ b/crates/rust-analyzer/src/bin/args.rs @@ -52,7 +52,8 @@ FLAGS: --log-file <PATH> Log to the specified file instead of stderr --no-buffering Flush log records to the file immediately - --wait-dbg Wait until a debugger is attached to + --wait-dbg Wait until a debugger is attached to. + The flag is valid for debug builds only ENVIRONMENTAL VARIABLES: RA_LOG Set log filter in env_logger format diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs index 80637cbfff0..8f893986362 100644 --- a/crates/rust-analyzer/src/bin/main.rs +++ b/crates/rust-analyzer/src/bin/main.rs @@ -29,6 +29,8 @@ fn main() { fn try_main() -> Result<()> { let args = args::Args::parse()?; + + #[cfg(debug_assertions)] if args.wait_dbg || env::var("RA_WAIT_DBG").is_ok() { #[allow(unused_mut)] let mut d = 4; |
