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:
parent
5ce29d3d6f
commit
b1f8bd6356
21 changed files with 125 additions and 76 deletions
|
|
@ -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>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue