1
Fork 0

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

@ -567,10 +567,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
rustc_attr!(TEST, rustc_dump_user_substs, AssumedUsed, template!(Word)), rustc_attr!(TEST, rustc_dump_user_substs, AssumedUsed, template!(Word)),
rustc_attr!(TEST, rustc_if_this_changed, AssumedUsed, template!(Word, List: "DepNode")), rustc_attr!(TEST, rustc_if_this_changed, AssumedUsed, template!(Word, List: "DepNode")),
rustc_attr!(TEST, rustc_then_this_would_need, AssumedUsed, template!(List: "DepNode")), rustc_attr!(TEST, rustc_then_this_would_need, AssumedUsed, template!(List: "DepNode")),
rustc_attr!(
TEST, rustc_dirty, AssumedUsed,
template!(List: r#"cfg = "...", /*opt*/ label = "...", /*opt*/ except = "...""#),
),
rustc_attr!( rustc_attr!(
TEST, rustc_clean, AssumedUsed, TEST, rustc_clean, AssumedUsed,
template!(List: r#"cfg = "...", /*opt*/ label = "...", /*opt*/ except = "...""#), template!(List: r#"cfg = "...", /*opt*/ label = "...", /*opt*/ except = "...""#),

View file

@ -1,6 +1,5 @@
//! Debugging code to test fingerprints computed for query results. //! Debugging code to test fingerprints computed for query results. For each node marked with
//! For each node marked with `#[rustc_clean]` or `#[rustc_dirty]`, //! `#[rustc_clean]` we will compare the fingerprint from the current and from the previous
//! we will compare the fingerprint from the current and from the previous
//! compilation session as appropriate: //! compilation session as appropriate:
//! //!
//! - `#[rustc_clean(cfg="rev2", except="typeck")]` if we are //! - `#[rustc_clean(cfg="rev2", except="typeck")]` if we are
@ -132,7 +131,7 @@ pub fn check_dirty_clean_annotations(tcx: TyCtxt<'_>) {
return; return;
} }
// can't add `#[rustc_dirty]` etc without opting in to this feature // can't add `#[rustc_clean]` etc without opting in to this feature
if !tcx.features().rustc_attrs { if !tcx.features().rustc_attrs {
return; return;
} }
@ -142,11 +141,7 @@ pub fn check_dirty_clean_annotations(tcx: TyCtxt<'_>) {
let mut dirty_clean_visitor = DirtyCleanVisitor { tcx, checked_attrs: Default::default() }; let mut dirty_clean_visitor = DirtyCleanVisitor { tcx, checked_attrs: Default::default() };
krate.visit_all_item_likes(&mut dirty_clean_visitor); krate.visit_all_item_likes(&mut dirty_clean_visitor);
let mut all_attrs = FindAllAttrs { let mut all_attrs = FindAllAttrs { tcx, found_attrs: vec![] };
tcx,
attr_names: &[sym::rustc_dirty, sym::rustc_clean],
found_attrs: vec![],
};
intravisit::walk_crate(&mut all_attrs, krate); intravisit::walk_crate(&mut all_attrs, krate);
// Note that we cannot use the existing "unused attribute"-infrastructure // Note that we cannot use the existing "unused attribute"-infrastructure
@ -164,29 +159,20 @@ pub struct DirtyCleanVisitor<'tcx> {
impl DirtyCleanVisitor<'tcx> { impl DirtyCleanVisitor<'tcx> {
/// Possibly "deserialize" the attribute into a clean/dirty assertion /// Possibly "deserialize" the attribute into a clean/dirty assertion
fn assertion_maybe(&mut self, item_id: LocalDefId, attr: &Attribute) -> Option<Assertion> { fn assertion_maybe(&mut self, item_id: LocalDefId, attr: &Attribute) -> Option<Assertion> {
let is_clean = if self.tcx.sess.check_name(attr, sym::rustc_dirty) { if !self.tcx.sess.check_name(attr, sym::rustc_clean) {
false
} else if self.tcx.sess.check_name(attr, sym::rustc_clean) {
true
} else {
// skip: not rustc_clean/dirty // skip: not rustc_clean/dirty
return None; return None;
}; }
if !check_config(self.tcx, attr) { if !check_config(self.tcx, attr) {
// skip: not the correct `cfg=` // skip: not the correct `cfg=`
return None; return None;
} }
let assertion = self.assertion_auto(item_id, attr, is_clean); let assertion = self.assertion_auto(item_id, attr);
Some(assertion) Some(assertion)
} }
/// Gets the "auto" assertion on pre-validated attr, along with the `except` labels. /// Gets the "auto" assertion on pre-validated attr, along with the `except` labels.
fn assertion_auto( fn assertion_auto(&mut self, item_id: LocalDefId, attr: &Attribute) -> Assertion {
&mut self,
item_id: LocalDefId,
attr: &Attribute,
is_clean: bool,
) -> Assertion {
let (name, mut auto) = self.auto_labels(item_id, attr); let (name, mut auto) = self.auto_labels(item_id, attr);
let except = self.except(attr); let except = self.except(attr);
for e in except.iter() { for e in except.iter() {
@ -198,11 +184,7 @@ impl DirtyCleanVisitor<'tcx> {
self.tcx.sess.span_fatal(attr.span, &msg); self.tcx.sess.span_fatal(attr.span, &msg);
} }
} }
if is_clean {
Assertion { clean: auto, dirty: except } Assertion { clean: auto, dirty: except }
} else {
Assertion { clean: except, dirty: auto }
}
} }
/// `except=` attribute value /// `except=` attribute value
@ -398,9 +380,8 @@ impl ItemLikeVisitor<'tcx> for DirtyCleanVisitor<'tcx> {
} }
} }
/// Given a `#[rustc_dirty]` or `#[rustc_clean]` attribute, scan /// Given a `#[rustc_clean]` attribute, scan for a `cfg="foo"` attribute and check whether we have
/// for a `cfg="foo"` attribute and check whether we have a cfg /// a cfg flag called `foo`.
/// flag called `foo`.
fn check_config(tcx: TyCtxt<'_>, attr: &Attribute) -> bool { fn check_config(tcx: TyCtxt<'_>, attr: &Attribute) -> bool {
debug!("check_config(attr={:?})", attr); debug!("check_config(attr={:?})", attr);
let config = &tcx.sess.parse_sess.config; let config = &tcx.sess.parse_sess.config;
@ -436,22 +417,19 @@ fn expect_associated_value(tcx: TyCtxt<'_>, item: &NestedMetaItem) -> Symbol {
} }
} }
// A visitor that collects all #[rustc_dirty]/#[rustc_clean] attributes from // A visitor that collects all #[rustc_clean] attributes from
// the HIR. It is used to verify that we really ran checks for all annotated // the HIR. It is used to verify that we really ran checks for all annotated
// nodes. // nodes.
pub struct FindAllAttrs<'a, 'tcx> { pub struct FindAllAttrs<'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
attr_names: &'a [Symbol],
found_attrs: Vec<&'tcx Attribute>, found_attrs: Vec<&'tcx Attribute>,
} }
impl FindAllAttrs<'_, 'tcx> { impl FindAllAttrs<'tcx> {
fn is_active_attr(&mut self, attr: &Attribute) -> bool { fn is_active_attr(&mut self, attr: &Attribute) -> bool {
for attr_name in self.attr_names { if self.tcx.sess.check_name(attr, sym::rustc_clean) && check_config(self.tcx, attr) {
if self.tcx.sess.check_name(attr, *attr_name) && check_config(self.tcx, attr) {
return true; return true;
} }
}
false false
} }
@ -459,17 +437,14 @@ impl FindAllAttrs<'_, 'tcx> {
fn report_unchecked_attrs(&self, mut checked_attrs: FxHashSet<ast::AttrId>) { fn report_unchecked_attrs(&self, mut checked_attrs: FxHashSet<ast::AttrId>) {
for attr in &self.found_attrs { for attr in &self.found_attrs {
if !checked_attrs.contains(&attr.id) { if !checked_attrs.contains(&attr.id) {
self.tcx.sess.span_err( self.tcx.sess.span_err(attr.span, "found unchecked `#[rustc_clean]` attribute");
attr.span,
"found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute",
);
checked_attrs.insert(attr.id); checked_attrs.insert(attr.id);
} }
} }
} }
} }
impl intravisit::Visitor<'tcx> for FindAllAttrs<'_, 'tcx> { impl intravisit::Visitor<'tcx> for FindAllAttrs<'tcx> {
type Map = Map<'tcx>; type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> { fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {

View file

@ -25,7 +25,10 @@ mod x {
mod y { mod y {
use x; 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() { pub fn y() {
//[cfail2]~^ ERROR `hir_owner(y)` should be dirty but is not //[cfail2]~^ ERROR `hir_owner(y)` should be dirty but is not
//[cfail2]~| ERROR `hir_owner_nodes(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))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumChangeNameOfTypeParameter<T> { enum EnumChangeNameOfTypeParameter<T> {
Variant1(T), Variant1(T),
@ -386,7 +386,7 @@ enum EnumAddTypeParameter<S> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddTypeParameter<S, T> { enum EnumAddTypeParameter<S, T> {
Variant1(S), Variant1(S),
@ -402,7 +402,7 @@ enum EnumChangeNameOfLifetimeParameter<'a> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumChangeNameOfLifetimeParameter<'b> { enum EnumChangeNameOfLifetimeParameter<'b> {
Variant1(&'b u32), Variant1(&'b u32),
@ -418,7 +418,7 @@ enum EnumAddLifetimeParameter<'a> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeParameter<'a, 'b> { enum EnumAddLifetimeParameter<'a, 'b> {
Variant1(&'a u32), Variant1(&'a u32),
@ -435,7 +435,7 @@ enum EnumAddLifetimeParameterBound<'a, 'b> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeParameterBound<'a, 'b: 'a> { enum EnumAddLifetimeParameterBound<'a, 'b: 'a> {
Variant1(&'a u32), Variant1(&'a u32),
@ -450,7 +450,7 @@ enum EnumAddLifetimeBoundToParameter<'a, T> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeBoundToParameter<'a, T: 'a> { enum EnumAddLifetimeBoundToParameter<'a, T: 'a> {
Variant1(T), Variant1(T),
@ -466,7 +466,7 @@ enum EnumAddTraitBound<S> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddTraitBound<T: Sync> { enum EnumAddTraitBound<T: Sync> {
Variant1(T), Variant1(T),
@ -482,7 +482,7 @@ enum EnumAddLifetimeParameterBoundWhere<'a, 'b> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeParameterBoundWhere<'a, 'b> where 'b: 'a { enum EnumAddLifetimeParameterBoundWhere<'a, 'b> where 'b: 'a {
Variant1(&'a u32), Variant1(&'a u32),
@ -499,7 +499,7 @@ enum EnumAddLifetimeBoundToParameterWhere<'a, T> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddLifetimeBoundToParameterWhere<'a, T> where T: 'a { enum EnumAddLifetimeBoundToParameterWhere<'a, T> where T: 'a {
Variant1(T), Variant1(T),
@ -515,7 +515,7 @@ enum EnumAddTraitBoundWhere<S> {
} }
#[cfg(not(cfail1))] #[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")] #[rustc_clean(cfg="cfail3")]
enum EnumAddTraitBoundWhere<T> where T: Sync { enum EnumAddTraitBoundWhere<T> where T: Sync {
Variant1(T), Variant1(T),

View file

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

View file

@ -4,20 +4,20 @@
#![allow(warnings)] #![allow(warnings)]
#![feature(rustc_attrs)] #![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 // attributes in places that are not checked and make sure that this causes an
// error. // error.
fn main() { fn main() {
#[rustc_clean(except="hir_owner", cfg="cfail2")] #[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 // empty block
} }
#[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail2")]
//[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute //[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
{ {
// empty block // empty block
} }
@ -25,10 +25,10 @@ fn main() {
struct _Struct { struct _Struct {
#[rustc_clean(except="hir_owner", cfg="cfail2")] #[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, _field1: i32,
#[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail2")]
//[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute //[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
_field2: i32, _field2: i32,
} }

View file

@ -5,7 +5,7 @@
#![allow(dead_code)] #![allow(dead_code)]
#![allow(unused_variables)] #![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() {} fn main() {}
#[rustc_if_this_changed(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph #[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 error: attribute requires -Z query-dep-graph to be enabled
--> $DIR/dep-graph-check-attr.rs:8:1 --> $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 error: attribute requires -Z query-dep-graph to be enabled