]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/ref_binding_to_reference.rs
2 // FIXME: run-rustfix waiting on multi-span suggestions
4 #![warn(clippy::ref_binding_to_reference)]
5 #![allow(clippy::needless_borrowed_reference)]
21 let x
= String
::new();
23 // Ok, the pattern is from a macro
24 let _
: &&String
= match Some(&x
) {
29 // Err, reference to a &String
30 let _
: &&String
= match Some(&x
) {
35 // Err, reference to a &String
36 let _
: &&String
= match Some(&x
) {
45 // Err, reference to a &String
47 Some(ref x
) => m2
!(x
),
51 // Err, reference to a &String
52 let _
= |&ref x
: &&String
| {
57 // Err, reference to a &String
58 fn f2
<'a
>(&ref x
: &&'a String
) -> &'a String
{
64 // Err, reference to a &String
65 fn f(&ref x
: &&String
) {
72 // Err, reference to a &String
73 fn f(&ref x
: &&String
) {