mir: use attribute over -Z polymorphize-errors

This commit replaces the `-Z polymorphize-errors` debugging flag with a
`#[rustc_polymorphize_error]` attribute for use on functions.

Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
David Wood 2020-07-16 17:52:23 +01:00
parent 5ce29d3d6f
commit b1f8bd6356
No known key found for this signature in database
GPG key ID: 2592E76C87381FD9
21 changed files with 125 additions and 76 deletions

View file

@ -1,13 +1,15 @@
// build-fail
// compile-flags: -Zpolymorphize-errors
#![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<I>() {
//~^ ERROR item has unused generic parameters
//~^ ERROR item has unused generic parameters
}
#[rustc_polymorphize_error]
fn foo<I, T>(_: I)
where
I: Iterator<Item = T>,