Skip to content

Commit b4738a6

Browse files
committed
Add test for rust-lang#10535
1 parent 6ae065f commit b4738a6

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/ui/needless_borrow.fixed

+12
Original file line numberDiff line numberDiff line change
@@ -492,3 +492,15 @@ mod issue_9782_method_variant {
492492
S.foo::<&[u8; 100]>(&a);
493493
}
494494
}
495+
496+
mod issue_10535 {
497+
static SOME_STATIC: String = String::new();
498+
499+
static UNIT: () = compute(&SOME_STATIC);
500+
501+
pub const fn compute<T>(_: T)
502+
where
503+
T: Copy,
504+
{
505+
}
506+
}

tests/ui/needless_borrow.rs

+12
Original file line numberDiff line numberDiff line change
@@ -492,3 +492,15 @@ mod issue_9782_method_variant {
492492
S.foo::<&[u8; 100]>(&a);
493493
}
494494
}
495+
496+
mod issue_10535 {
497+
static SOME_STATIC: String = String::new();
498+
499+
static UNIT: () = compute(&SOME_STATIC);
500+
501+
pub const fn compute<T>(_: T)
502+
where
503+
T: Copy,
504+
{
505+
}
506+
}

0 commit comments

Comments
 (0)