about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-01-29 14:27:02 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-01-31 08:27:15 +1100
commit97d1b0cbcdd133c23271d68f25d1d22c65a055c0 (patch)
tree844ba6bf8c462f15e32a338042f77fcf4da07c3a
parent6ac88786155774da429213a1362d4cb085047af3 (diff)
downloadrust-97d1b0cbcdd133c23271d68f25d1d22c65a055c0.tar.gz
rust-97d1b0cbcdd133c23271d68f25d1d22c65a055c0.zip
Clarify a comment.
I was confused here for a bit.
-rw-r--r--compiler/rustc_hir_analysis/src/check/intrinsic.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
index 8aa95d1c1d5..cf3d4897304 100644
--- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs
+++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
@@ -199,7 +199,8 @@ pub fn check_intrinsic_type(
         let split: Vec<&str> = name_str.split('_').collect();
         assert!(split.len() >= 2, "Atomic intrinsic in an incorrect format");
 
-        //We only care about the operation here
+        // Each atomic op has variants with different suffixes (`_seq_cst`, `_acquire`, etc.). Use
+        // string ops to strip the suffixes, because the variants all get the same treatment here.
         let (n_tps, inputs, output) = match split[1] {
             "cxchg" | "cxchgweak" => (
                 1,