Skip to content

Commit ea03ad9

Browse files
committed
Auto merge of rust-lang#23809 - cmr:issue-21310, r=Manishearth
This isn't really possible to test in an automatic way, since the only traits you can negative impl are `Send` and `Sync`, and the implementors page for those only exists in libstd. Closes rust-lang#21310
2 parents fa3d778 + 8d6fb44 commit ea03ad9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustdoc/html/render.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ pub struct Implementor {
125125
pub trait_: clean::Type,
126126
pub for_: clean::Type,
127127
pub stability: Option<clean::Stability>,
128+
pub polarity: Option<clean::ImplPolarity>,
128129
}
129130

130131
/// Metadata about implementations for a type.
@@ -635,9 +636,11 @@ fn write_shared(cx: &Context,
635636
// going on). If they're in different crates then the crate defining
636637
// the trait will be interested in our implementation.
637638
if imp.def_id.krate == did.krate { continue }
638-
try!(write!(&mut f, r#""{}impl{} {} for {}","#,
639+
try!(write!(&mut f, r#""{}impl{} {}{} for {}","#,
639640
ConciseStability(&imp.stability),
640-
imp.generics, imp.trait_, imp.for_));
641+
imp.generics,
642+
if imp.polarity == Some(clean::ImplPolarity::Negative) { "!" } else { "" },
643+
imp.trait_, imp.for_));
641644
}
642645
try!(writeln!(&mut f, r"];"));
643646
try!(writeln!(&mut f, "{}", r"
@@ -882,6 +885,7 @@ impl DocFolder for Cache {
882885
trait_: i.trait_.as_ref().unwrap().clone(),
883886
for_: i.for_.clone(),
884887
stability: item.stability.clone(),
888+
polarity: i.polarity.clone(),
885889
});
886890
}
887891
Some(..) | None => {}

0 commit comments

Comments
 (0)