// build-fail // compile-flags:-Zpolymorphize=on #![feature(rustc_attrs)] // This test checks that `T` is considered used in `foo`, because it is used in a predicate for // `I`, which is used. #[rustc_polymorphize_error] fn bar() { //~^ ERROR item has unused generic parameters } #[rustc_polymorphize_error] fn foo(_: I) where I: Iterator, { bar::() } fn main() { let x = &[2u32]; foo(x.iter()); }