Skip to content

Commit

Permalink
Add test for rust-lang#10535
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jul 8, 2023
1 parent 6ae065f commit b4738a6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ui/needless_borrow.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -492,3 +492,15 @@ mod issue_9782_method_variant {
S.foo::<&[u8; 100]>(&a);
}
}

mod issue_10535 {
static SOME_STATIC: String = String::new();

static UNIT: () = compute(&SOME_STATIC);

pub const fn compute<T>(_: T)
where
T: Copy,
{
}
}
12 changes: 12 additions & 0 deletions tests/ui/needless_borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,3 +492,15 @@ mod issue_9782_method_variant {
S.foo::<&[u8; 100]>(&a);
}
}

mod issue_10535 {
static SOME_STATIC: String = String::new();

static UNIT: () = compute(&SOME_STATIC);

pub const fn compute<T>(_: T)
where
T: Copy,
{
}
}

0 comments on commit b4738a6

Please sign in to comment.