//@ revisions: a b #![crate_type = "lib"] #![feature(alloc_error_handler)] #![feature(cfg_accessible)] #![feature(cfg_eval)] #![feature(custom_test_frameworks)] #![feature(derive_const)] #![feature(where_clause_attrs)] #![allow(soft_unstable)] use std::marker::PhantomData; #[cfg(a)] trait TraitA {} #[cfg(b)] trait TraitB {} #[cfg_attr(a, cfg(a))] trait TraitAA {} #[cfg_attr(b, cfg(b))] trait TraitBB {} trait A where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses { type B where #[cfg(a)] U: TraitA, #[cfg(b)] U: TraitB, #[cfg_attr(a, cfg(a))] U: TraitAA, #[cfg_attr(b, cfg(b))] U: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():; //~ ERROR most attributes are not supported in `where` clauses fn foo(&self) where #[cfg(a)] U: TraitA, #[cfg(b)] U: TraitB, #[cfg_attr(a, cfg(a))] U: TraitAA, #[cfg_attr(b, cfg(b))] U: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():; //~ ERROR most attributes are not supported in `where` clauses } impl A for T where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses { type B = () where #[cfg(a)] U: TraitA, #[cfg(b)] U: TraitB, #[cfg_attr(a, cfg(a))] U: TraitAA, #[cfg_attr(b, cfg(b))] U: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():; //~ ERROR most attributes are not supported in `where` clauses fn foo(&self) where #[cfg(a)] U: TraitA, #[cfg(b)] U: TraitB, #[cfg_attr(a, cfg(a))] U: TraitAA, #[cfg_attr(b, cfg(b))] U: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses {} } struct C where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses { _t: PhantomData, } union D where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses { _t: PhantomData, } enum E where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses { E(PhantomData), } #[allow(type_alias_bounds)] type F where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses = T; impl C where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses { fn new() where #[cfg(a)] U: TraitA, #[cfg(b)] U: TraitB, #[cfg_attr(a, cfg(a))] U: TraitAA, #[cfg_attr(b, cfg(b))] U: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses {} } fn foo() where #[cfg(a)] T: TraitA, #[cfg(b)] T: TraitB, #[cfg_attr(a, cfg(a))] T: TraitAA, #[cfg_attr(b, cfg(b))] T: TraitBB, #[derive(Clone)] ():, //~^ ERROR most attributes are not supported in `where` clauses //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] ():, //~ ERROR most attributes are not supported in `where` clauses { }