Remove potential cfgs duplicates
This commit is contained in:
parent
8f1bbd69e1
commit
a8ec6200df
@ -209,6 +209,9 @@ fn not(self) -> Cfg {
|
||||
|
||||
impl ops::BitAndAssign for Cfg {
|
||||
fn bitand_assign(&mut self, other: Cfg) {
|
||||
if *self == other {
|
||||
return;
|
||||
}
|
||||
match (self, other) {
|
||||
(&mut Cfg::False, _) | (_, Cfg::True) => {},
|
||||
(s, Cfg::False) => *s = Cfg::False,
|
||||
@ -238,6 +241,9 @@ fn bitand(mut self, other: Cfg) -> Cfg {
|
||||
|
||||
impl ops::BitOrAssign for Cfg {
|
||||
fn bitor_assign(&mut self, other: Cfg) {
|
||||
if *self == other {
|
||||
return;
|
||||
}
|
||||
match (self, other) {
|
||||
(&mut Cfg::True, _) | (_, Cfg::False) => {},
|
||||
(s, Cfg::True) => *s = Cfg::True,
|
||||
|
15
src/test/rustdoc/duplicate-cfg.rs
Normal file
15
src/test/rustdoc/duplicate-cfg.rs
Normal file
@ -0,0 +1,15 @@
|
||||
#![crate_name = "foo"]
|
||||
#![feature(doc_cfg)]
|
||||
|
||||
// @has 'foo/index.html'
|
||||
// @!has '-' '//*[@class="stab portability"]' 'feature="sync" and'
|
||||
// @has '-' '//*[@class="stab portability"]' 'feature="sync"'
|
||||
#[doc(cfg(feature = "sync"))]
|
||||
#[doc(cfg(feature = "sync"))]
|
||||
pub struct Foo;
|
||||
|
||||
#[doc(cfg(feature = "sync"))]
|
||||
pub mod bar {
|
||||
#[doc(cfg(feature = "sync"))]
|
||||
pub struct Bar;
|
||||
}
|
Loading…
Reference in New Issue
Block a user