about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/place.rs
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_const_eval/src/interpret/place.rs
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_const_eval/src/interpret/place.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/place.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/place.rs b/compiler/rustc_const_eval/src/interpret/place.rs
index 0d974071619..c97922ac132 100644
--- a/compiler/rustc_const_eval/src/interpret/place.rs
+++ b/compiler/rustc_const_eval/src/interpret/place.rs
@@ -1017,9 +1017,9 @@ where
     /// This is allocated in immutable global memory and deduplicated.
     pub fn allocate_str_dedup(
         &mut self,
-        str: &str,
+        s: &str,
     ) -> InterpResult<'tcx, MPlaceTy<'tcx, M::Provenance>> {
-        let bytes = str.as_bytes();
+        let bytes = s.as_bytes();
         let ptr = self.allocate_bytes_dedup(bytes)?;
 
         // Create length metadata for the string.