diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2025-03-22 14:16:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-22 14:16:52 +0000 |
| commit | d9934328dd72adcd38beb49d0feed1234fa36474 (patch) | |
| tree | 6f653f1199aaa211f194a39672a57ae2c504441d /tests | |
| parent | e8e0126c1804d6c579ec747c32fe4200aaa49699 (diff) | |
| parent | a463154bf0a4028fb6f4027ad58fc45a30379103 (diff) | |
| download | rust-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.fixed | 12 | ||||
| -rw-r--r-- | tests/ui/op_ref.rs | 12 |
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 + } +} |
