diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-06-15 22:04:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-15 22:04:55 +0200 |
| commit | db7d8374c1b6f1e2e8297f43e6a2cbffeff21882 (patch) | |
| tree | e770a1b8eebbea854cf6511a900ac7fadbf811cc /tests | |
| parent | ab314a57fa6141d1c5436fb6dbb500adbde3e64b (diff) | |
| parent | 1caed5167369cf026f4159b4011cbd55f5c39ccd (diff) | |
| download | rust-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.rs | 17 |
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(); +} |
