rust/tests/ui/multiple_bound_locations.rs

61 lines
1000 B
Rust
Raw Normal View History

#![warn(clippy::multiple_bound_locations)]
fn ty<F: std::fmt::Debug>(a: F)
//~^ ERROR: bound is defined in more than one place
where
F: Sized,
{
}
fn lifetime<'a, 'b: 'a, 'c>(a: &'b str, b: &'a str, c: &'c str)
//~^ ERROR: bound is defined in more than one place
where
'b: 'c,
{
}
fn ty_pred<F: Sized>()
//~^ ERROR: bound is defined in more than one place
where
for<'a> F: Send + 'a,
{
}
struct B;
impl B {
fn ty<F: std::fmt::Debug>(a: F)
//~^ ERROR: bound is defined in more than one place
where
F: Sized,
{
}
fn lifetime<'a, 'b: 'a, 'c>(a: &'b str, b: &'a str, c: &'c str)
//~^ ERROR: bound is defined in more than one place
where
'b: 'c,
{
}
fn ty_pred<F: Sized>()
//~^ ERROR: bound is defined in more than one place
where
for<'a> F: Send + 'a,
{
}
}
struct C<F>(F);
impl<F> C<F> {
fn foo(_f: F) -> Self
2024-02-10 08:09:12 -06:00
where
F: std::fmt::Display,
{
2024-02-10 08:09:12 -06:00
todo!()
}
}
fn main() {}