about summary refs log tree commit diff
path: root/compiler/rustc_log
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2025-01-07 14:12:07 +0200
committerJosh Triplett <josh@joshtriplett.org>2025-01-07 14:30:02 +0200
commitbb6bbfa13f97e6ef30ecd63c835c99cf7762bd6e (patch)
tree72903e70f117fddc546a875d4fff4285c11c00d1 /compiler/rustc_log
parentfb546ee09b226bc4dd4b712d35a372d923c4fa54 (diff)
downloadrust-bb6bbfa13f97e6ef30ecd63c835c99cf7762bd6e.tar.gz
rust-bb6bbfa13f97e6ef30ecd63c835c99cf7762bd6e.zip
Avoid naming variables `str`
This renames variables named `str` to other names, to make sure `str`
always refers to a type.

It's confusing to read code where `str` (or another standard type name)
is used as an identifier. It also produces misleading syntax
highlighting.
Diffstat (limited to 'compiler/rustc_log')
-rw-r--r--compiler/rustc_log/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_log/src/lib.rs b/compiler/rustc_log/src/lib.rs
index a3890fc937e..d0ef82f4a6c 100644
--- a/compiler/rustc_log/src/lib.rs
+++ b/compiler/rustc_log/src/lib.rs
@@ -130,11 +130,11 @@ pub fn init_logger(cfg: LoggerConfig) -> Result<(), Error> {
 
     let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);
     match cfg.backtrace {
-        Ok(str) => {
+        Ok(backtrace_target) => {
             let fmt_layer = tracing_subscriber::fmt::layer()
                 .with_writer(io::stderr)
                 .without_time()
-                .event_format(BacktraceFormatter { backtrace_target: str });
+                .event_format(BacktraceFormatter { backtrace_target });
             let subscriber = subscriber.with(fmt_layer);
             tracing::subscriber::set_global_default(subscriber).unwrap();
         }