未验证 提交 afd9e95b 编写于 作者: Y Yuki Okushi 提交者: GitHub

Rollup merge of #66959 - GuillaumeGomez:cfg-duplicates, r=eddyb

Remove potential cfgs duplicates

Fixes https://github.com/rust-lang/rust/issues/66921.

Before going any further (the issue seems to be linked to metadata as far as I can tell). Do you think this is the good place to do it or should it be done before?

r? @EddyB
......@@ -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,
......
#![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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册