about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-06-15 22:04:55 +0200
committerGitHub <noreply@github.com>2023-06-15 22:04:55 +0200
commitdb7d8374c1b6f1e2e8297f43e6a2cbffeff21882 (patch)
treee770a1b8eebbea854cf6511a900ac7fadbf811cc /tests
parentab314a57fa6141d1c5436fb6dbb500adbde3e64b (diff)
parent1caed5167369cf026f4159b4011cbd55f5c39ccd (diff)
downloadrust-db7d8374c1b6f1e2e8297f43e6a2cbffeff21882.tar.gz
rust-db7d8374c1b6f1e2e8297f43e6a2cbffeff21882.zip
Rollup merge of #112517 - fee1-dead-contrib:sus-op-no-borrow, r=compiler-errors
`suspicious_double_ref_op`: don't lint on `.borrow()`

closes #112489
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/lint/issue-112489.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/lint/issue-112489.rs b/tests/ui/lint/issue-112489.rs
new file mode 100644
index 00000000000..559edf0e4f2
--- /dev/null
+++ b/tests/ui/lint/issue-112489.rs
@@ -0,0 +1,17 @@
+// check-pass
+use std::borrow::Borrow;
+
+struct S;
+
+trait T: Sized {
+    fn foo(self) {}
+}
+
+impl T for S {}
+impl T for &S {}
+
+fn main() {
+    let s = S;
+    s.borrow().foo();
+    s.foo();
+}