Skip to content

Commit ad603c3

Browse files
committed
Add debug only guard for the --wait-dbg flag
1 parent 185cd73 commit ad603c3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

crates/rust-analyzer/src/bin/args.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ FLAGS:
5252
--log-file <PATH> Log to the specified file instead of stderr
5353
--no-buffering Flush log records to the file immediately
5454
55-
--wait-dbg Wait until a debugger is attached to
55+
--wait-dbg Wait until a debugger is attached to.
56+
The flag is valid for debug builds only
5657
5758
ENVIRONMENTAL VARIABLES:
5859
RA_LOG Set log filter in env_logger format

crates/rust-analyzer/src/bin/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ fn main() {
2929

3030
fn try_main() -> Result<()> {
3131
let args = args::Args::parse()?;
32+
33+
#[cfg(debug_assertions)]
3234
if args.wait_dbg || env::var("RA_WAIT_DBG").is_ok() {
3335
#[allow(unused_mut)]
3436
let mut d = 4;

0 commit comments

Comments
 (0)