Remove remains of rustc_dirty.

This commit is contained in:
Camille GILLOT 2021-05-16 10:14:57 +02:00
parent 175345b864
commit fc069d3241
9 changed files with 56 additions and 79 deletions

View file

@ -25,7 +25,10 @@ mod x {
mod y {
use x;
#[rustc_dirty(except="typeck", cfg="cfail2")]
#[rustc_clean(
except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of,fn_sig",
cfg="cfail2",
)]
pub fn y() {
//[cfail2]~^ ERROR `hir_owner(y)` should be dirty but is not
//[cfail2]~| ERROR `hir_owner_nodes(y)` should be dirty but is not

View file

@ -370,7 +370,7 @@ enum EnumChangeNameOfTypeParameter<S> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeNameOfTypeParameter<T> {
Variant1(T),
@ -386,7 +386,7 @@ enum EnumAddTypeParameter<S> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddTypeParameter<S, T> {
Variant1(S),
@ -402,7 +402,7 @@ enum EnumChangeNameOfLifetimeParameter<'a> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2", except="predicates_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeNameOfLifetimeParameter<'b> {
Variant1(&'b u32),
@ -418,7 +418,7 @@ enum EnumAddLifetimeParameter<'a> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2", except="predicates_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeParameter<'a, 'b> {
Variant1(&'a u32),
@ -435,7 +435,7 @@ enum EnumAddLifetimeParameterBound<'a, 'b> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2", except="generics_of,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeParameterBound<'a, 'b: 'a> {
Variant1(&'a u32),
@ -450,7 +450,7 @@ enum EnumAddLifetimeBoundToParameter<'a, T> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2", except="type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeBoundToParameter<'a, T: 'a> {
Variant1(T),
@ -466,7 +466,7 @@ enum EnumAddTraitBound<S> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddTraitBound<T: Sync> {
Variant1(T),
@ -482,7 +482,7 @@ enum EnumAddLifetimeParameterBoundWhere<'a, 'b> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2", except="generics_of,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeParameterBoundWhere<'a, 'b> where 'b: 'a {
Variant1(&'a u32),
@ -499,7 +499,7 @@ enum EnumAddLifetimeBoundToParameterWhere<'a, T> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2", except="type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeBoundToParameterWhere<'a, T> where T: 'a {
Variant1(T),
@ -515,7 +515,7 @@ enum EnumAddTraitBoundWhere<S> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddTraitBoundWhere<T> where T: Sync {
Variant1(T),

View file

@ -21,7 +21,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_function_name2(c: i64) -> i32;
@ -34,7 +34,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_parameter_name(d: i64) -> i32;
@ -47,7 +47,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_parameter_type(c: i32) -> i32;
@ -60,7 +60,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_return_type(c: i32) -> i8;
@ -73,7 +73,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn add_parameter(c: i32, d: i32) -> i32;
@ -86,7 +86,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn add_return_type(c: i32) -> i32;
@ -99,7 +99,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn make_function_variadic(c: i32, ...);
@ -112,7 +112,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner")]
#[rustc_clean(cfg = "cfail3")]
extern "rust-call" {
pub fn change_calling_convention(c: i32);
@ -125,7 +125,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn make_function_public(c: i32);
@ -138,7 +138,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn add_function1(c: i32);
@ -153,7 +153,7 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
#[link(name = "bar")]
extern "C" {
@ -170,7 +170,7 @@ mod indirectly_change_parameter_type {
#[cfg(not(cfail1))]
use super::c_i64 as c_int;
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn indirectly_change_parameter_type(c: c_int);
@ -184,7 +184,7 @@ mod indirectly_change_return_type {
#[cfg(not(cfail1))]
use super::c_i64 as c_int;
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn indirectly_change_return_type() -> c_int;

View file

@ -103,7 +103,10 @@ impl Foo {
#[rustc_clean(cfg="cfail2", except="hir_owner")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_dirty(cfg="cfail2", except="type_of,predicates_of,promoted_mir")]
#[rustc_clean(
cfg="cfail2",
except="hir_owner,hir_owner_nodes,fn_sig,generics_of,typeck,associated_item,optimized_mir",
)]
#[rustc_clean(cfg="cfail3")]
pub fn method_selfness(&self) { }
}

View file

@ -4,20 +4,20 @@
#![allow(warnings)]
#![feature(rustc_attrs)]
// Sanity check for the dirty-clean system. We add #[rustc_dirty]/#[rustc_clean]
// Sanity check for the dirty-clean system. We add #[rustc_clean]
// attributes in places that are not checked and make sure that this causes an
// error.
fn main() {
#[rustc_clean(except="hir_owner", cfg="cfail2")]
//[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
//[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
{
// empty block
}
#[rustc_clean(cfg="cfail2")]
//[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
//[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
{
// empty block
}
@ -25,10 +25,10 @@ fn main() {
struct _Struct {
#[rustc_clean(except="hir_owner", cfg="cfail2")]
//[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
//[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
_field1: i32,
#[rustc_clean(cfg="cfail2")]
//[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
//[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
_field2: i32,
}

View file

@ -5,7 +5,7 @@
#![allow(dead_code)]
#![allow(unused_variables)]
#[rustc_dirty(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph
#[rustc_clean(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph
fn main() {}
#[rustc_if_this_changed(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph

View file

@ -1,7 +1,7 @@
error: attribute requires -Z query-dep-graph to be enabled
--> $DIR/dep-graph-check-attr.rs:8:1
|
LL | #[rustc_dirty(hir_owner)]
LL | #[rustc_clean(hir_owner)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: attribute requires -Z query-dep-graph to be enabled