about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorJason Newcomb <jsnewcomb@pm.me>2025-03-22 14:16:52 +0000
committerGitHub <noreply@github.com>2025-03-22 14:16:52 +0000
commitd9934328dd72adcd38beb49d0feed1234fa36474 (patch)
tree6f653f1199aaa211f194a39672a57ae2c504441d /tests
parente8e0126c1804d6c579ec747c32fe4200aaa49699 (diff)
parenta463154bf0a4028fb6f4027ad58fc45a30379103 (diff)
downloadrust-d9934328dd72adcd38beb49d0feed1234fa36474.tar.gz
rust-d9934328dd72adcd38beb49d0feed1234fa36474.zip
set the applicability of `op_ref` to `MachineApplicable` (#14438)
#2597 appears to be already resolved, so the applicability of `op_ref`
can be set to `MachineApplicable`.

close #2597

changelog: [`op_ref`]: set the applicability to `MachineApplicable`
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/op_ref.fixed12
-rw-r--r--tests/ui/op_ref.rs12
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/op_ref.fixed b/tests/ui/op_ref.fixed
index 46a59e419cc..f412190b9fd 100644
--- a/tests/ui/op_ref.fixed
+++ b/tests/ui/op_ref.fixed
@@ -98,3 +98,15 @@ impl Mul<A> for A {
         self * &rhs
     }
 }
+
+mod issue_2597 {
+    fn ex1() {
+        let a: &str = "abc";
+        let b: String = "abc".to_owned();
+        println!("{}", a > &b);
+    }
+
+    pub fn ex2<T: Ord + PartialOrd>(array: &[T], val: &T, idx: usize) -> bool {
+        &array[idx] < val
+    }
+}
diff --git a/tests/ui/op_ref.rs b/tests/ui/op_ref.rs
index e10840ff4b9..a4bbd86c7e9 100644
--- a/tests/ui/op_ref.rs
+++ b/tests/ui/op_ref.rs
@@ -98,3 +98,15 @@ impl Mul<A> for A {
         self * &rhs
     }
 }
+
+mod issue_2597 {
+    fn ex1() {
+        let a: &str = "abc";
+        let b: String = "abc".to_owned();
+        println!("{}", a > &b);
+    }
+
+    pub fn ex2<T: Ord + PartialOrd>(array: &[T], val: &T, idx: usize) -> bool {
+        &array[idx] < val
+    }
+}