2020-06-22 12:57:03 +00:00
|
|
|
// build-fail
|
2020-07-16 16:52:23 +00:00
|
|
|
#![feature(rustc_attrs)]
|
2020-06-22 12:57:03 +00:00
|
|
|
|
|
|
|
// This test checks that `T` is considered used in `foo`, because it is used in a predicate for
|
|
|
|
// `I`, which is used.
|
|
|
|
|
2020-07-16 16:52:23 +00:00
|
|
|
#[rustc_polymorphize_error]
|
2020-06-22 12:57:03 +00:00
|
|
|
fn bar<I>() {
|
2020-07-16 16:52:23 +00:00
|
|
|
//~^ ERROR item has unused generic parameters
|
2020-06-22 12:57:03 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 16:52:23 +00:00
|
|
|
#[rustc_polymorphize_error]
|
2020-06-22 12:57:03 +00:00
|
|
|
fn foo<I, T>(_: I)
|
|
|
|
where
|
|
|
|
I: Iterator<Item = T>,
|
|
|
|
{
|
|
|
|
bar::<I>()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = &[2u32];
|
|
|
|
foo(x.iter());
|
|
|
|
}
|