diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-20 20:35:18 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-22 19:48:44 +0000 |
| commit | febb3f7c8814432f5905ecf31137a804c8a5cb1a (patch) | |
| tree | 7d5915d22761a1d5e79e94bc2abdbba17b365ab3 /src/librustdoc/html/format.rs | |
| parent | 86d69c705a552236a622eee3fdea94bf13c5f102 (diff) | |
| download | rust-febb3f7c8814432f5905ecf31137a804c8a5cb1a.tar.gz rust-febb3f7c8814432f5905ecf31137a804c8a5cb1a.zip | |
Represent TraitBoundModifiers as distinct parts in HIR
Diffstat (limited to 'src/librustdoc/html/format.rs')
| -rw-r--r-- | src/librustdoc/html/format.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 2e70a8c080d..5c599f20f9f 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -399,13 +399,13 @@ impl clean::GenericBound { ) -> impl Display + 'a + Captures<'tcx> { display_fn(move |f| match self { clean::GenericBound::Outlives(lt) => write!(f, "{}", lt.print()), - clean::GenericBound::TraitBound(ty, modifier) => { - f.write_str(match modifier { - hir::TraitBoundModifier::None => "", - hir::TraitBoundModifier::Maybe => "?", - hir::TraitBoundModifier::Negative => "!", - // `const` and `~const` trait bounds are experimental; don't render them. - hir::TraitBoundModifier::Const | hir::TraitBoundModifier::MaybeConst => "", + clean::GenericBound::TraitBound(ty, modifiers) => { + // `const` and `~const` trait bounds are experimental; don't render them. + let hir::TraitBoundModifiers { polarity, constness: _ } = modifiers; + f.write_str(match polarity { + hir::BoundPolarity::Positive => "", + hir::BoundPolarity::Maybe(_) => "?", + hir::BoundPolarity::Negative(_) => "!", })?; ty.print(cx).fmt(f) } |
